Commit e024e007954c4633f214eaa9b6295aff8bd1c714

Authored by Artur Faria
1 parent e3693641
Exists in follower_permition

Hide wall form to followers that aren't friends

Showing 1 changed file with 11 additions and 9 deletions   Show diff stats
app/views/profile/_profile_wall.html.erb
1 1 <h3><%= _("%s's wall") % @profile.name %></h3>
2   -<div id='leave_scrap'>
3   - <%= flash[:error] %>
4   - <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' }, :update => 'profile_activities', :success => "jQuery('#leave_scrap_content').val(''); jQuery('#filter-followed').tokenInput('clear')", :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)", :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)", :html => {:id => 'leave_scrap_form' } do %>
5   - <%= limited_text_area :scrap, :content, 420, 'leave_scrap_content', :rows => 2, :class => 'autogrow' %>
6   - <% if profile == user %>
7   - <%= token_input_field_tag(:filter_followed, 'filter-followed', {:action => 'search_followed'}, {:theme => 'facebook', :placeholder => _('Filter followed, friends or group of friends to send them a private scrap...')}) %>
  2 +<% if current_person.is_a_friend?(@profile) %>
  3 + <div id='leave_scrap'>
  4 + <%= flash[:error] %>
  5 + <%= form_remote_tag :url => {:controller => 'profile', :action => 'leave_scrap', :tab_action => 'wall' }, :update => 'profile_activities', :success => "jQuery('#leave_scrap_content').val(''); jQuery('#filter-followed').tokenInput('clear')", :complete => "jQuery('#leave_scrap_form').removeClass('loading').find('*').attr('disabled', false)", :loading => "jQuery('#leave_scrap_form').addClass('loading').find('*').attr('disabled', true)", :html => {:id => 'leave_scrap_form' } do %>
  6 + <%= limited_text_area :scrap, :content, 420, 'leave_scrap_content', :rows => 2, :class => 'autogrow' %>
  7 + <% if profile == user %>
  8 + <%= token_input_field_tag(:filter_followed, 'filter-followed', {:action => 'search_followed'}, {:theme => 'facebook', :placeholder => _('Filter followed, friends or group of friends to send them a private scrap...')}) %>
  9 + <% end %>
  10 + <%= submit_button :new, _('Share') %>
8 11 <% end %>
9   - <%= submit_button :new, _('Share') %>
10   - <% end %>
11   -</div>
  12 + </div>
  13 +<% end %>
12 14 <div id='leave_scrap_response'></div>
13 15 <ul id='profile_activities' class='profile-activities'>
14 16 <%= render :partial => 'profile_activities_list', :locals => {:activities => @activities} %>
... ...