Commit 6a5304ec58cc6599be19cfaf1732a07e16d960e9

Authored by Artur Faria
Committed by Gabriel Silva
1 parent ceba70c6

Create page to edit follows category

Signed-off-by: Artur Bersan de Faria <artur_bersan@hotmail.com>
Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
app/controllers/my_profile/followed_people_controller.rb
1 1 class FollowedPeopleController < MyProfileController
2 2  
3 3 def index
4   - @followed_people = [].paginate(:per_page => 5, :page => params[:npage], :total_entries => profile.friends.count)
  4 + @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage])
5 5 end
6 6  
7   -
  7 + def set_category
  8 + render :partial => "set_category_modal"
  9 + end
8 10 end
... ...
app/views/followed_people/_profile_list.html.erb
... ... @@ -7,9 +7,8 @@
7 7 <%= button_without_text :remove, content_tag('span',_('remove')),
8 8 { :action => 'remove', :id => profile.id },
9 9 :title => _('remove') %>
10   - <%= button_without_text 'menu-mail', content_tag('span',_('contact')),
11   - profile.url.merge(:controller => 'contact', :action => 'new', :profile => profile.identifier),
12   - :title => _('contact') %>
  10 + <%= modal_icon_button :change_categoy, content_tag('span',_('change category')),
  11 + profile.url.merge(:controller => 'followed_people', :action => 'set_category', :profile => profile.identifier)%>
13 12 </div><!-- end class="controll" -->
14 13 </li>
15 14 <% end %>
... ...
app/views/followed_people/_set_category_modal.html.erb 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +<div class='set-category-content'>
  2 + <h2><%= _("Select a category") %></h2>
  3 + <form>
  4 + <%= labelled_text_field _("Category: "), "person_category" %>
  5 + <%= submit_button('save', _('Save')) %>
  6 + <%= modal_close_button _("Cancel") %>
  7 + </form>
  8 +</div>
... ...