From 6a5304ec58cc6599be19cfaf1732a07e16d960e9 Mon Sep 17 00:00:00 2001 From: Artur Bersan de Faria Date: Wed, 8 Jun 2016 16:31:18 -0300 Subject: [PATCH] Create page to edit follows category --- app/controllers/my_profile/followed_people_controller.rb | 6 ++++-- app/views/followed_people/_profile_list.html.erb | 5 ++--- app/views/followed_people/_set_category_modal.html.erb | 8 ++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 app/views/followed_people/_set_category_modal.html.erb diff --git a/app/controllers/my_profile/followed_people_controller.rb b/app/controllers/my_profile/followed_people_controller.rb index 6be0587..ee38813 100644 --- a/app/controllers/my_profile/followed_people_controller.rb +++ b/app/controllers/my_profile/followed_people_controller.rb @@ -1,8 +1,10 @@ class FollowedPeopleController < MyProfileController def index - @followed_people = [].paginate(:per_page => 5, :page => params[:npage], :total_entries => profile.friends.count) + @followed_people = Person.all.limit(10).paginate(:per_page => 5, :page => params[:npage]) end - + def set_category + render :partial => "set_category_modal" + end end diff --git a/app/views/followed_people/_profile_list.html.erb b/app/views/followed_people/_profile_list.html.erb index 7351f40..d38a43d 100644 --- a/app/views/followed_people/_profile_list.html.erb +++ b/app/views/followed_people/_profile_list.html.erb @@ -7,9 +7,8 @@ <%= button_without_text :remove, content_tag('span',_('remove')), { :action => 'remove', :id => profile.id }, :title => _('remove') %> - <%= button_without_text 'menu-mail', content_tag('span',_('contact')), - profile.url.merge(:controller => 'contact', :action => 'new', :profile => profile.identifier), - :title => _('contact') %> + <%= modal_icon_button :change_categoy, content_tag('span',_('change category')), + profile.url.merge(:controller => 'followed_people', :action => 'set_category', :profile => profile.identifier)%> <% end %> diff --git a/app/views/followed_people/_set_category_modal.html.erb b/app/views/followed_people/_set_category_modal.html.erb new file mode 100644 index 0000000..dfa0d32 --- /dev/null +++ b/app/views/followed_people/_set_category_modal.html.erb @@ -0,0 +1,8 @@ +
+

<%= _("Select a category") %>

+
+ <%= labelled_text_field _("Category: "), "person_category" %> + <%= submit_button('save', _('Save')) %> + <%= modal_close_button _("Cancel") %> +
+
-- libgit2 0.21.2