From d0cc3c8aa04e050891e550169fae9dce0d4ed876 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Mon, 18 Jul 2016 15:04:14 -0300 Subject: [PATCH] Fixes unfollowing profile to use POST request --- app/views/blocks/profile_info_actions/_common.html.erb | 12 ++++++------ app/views/followers/_profile_list.html.erb | 2 +- features/follow_profile.feature | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/blocks/profile_info_actions/_common.html.erb b/app/views/blocks/profile_info_actions/_common.html.erb index 691a3dd..a59ef79 100644 --- a/app/views/blocks/profile_info_actions/_common.html.erb +++ b/app/views/blocks/profile_info_actions/_common.html.erb @@ -1,11 +1,11 @@
  • <%= report_abuse(profile, :button) %>
  • -<%if logged_in? && (user != profile) && profile.allow_followers?%> -
  • - <% follow = user.follows?(profile) %> - <%= button(:unfollow, content_tag('span', _('Unfollow')), {:profile => profile.identifier, :controller => 'profile', :action => 'unfollow'}, :id => 'action-unfollow', :title => _("Unfollow"), :style => follow ? "" : "display: none;") %> +<% if logged_in? && (user != profile) && profile.allow_followers? %> +
  • + <% follow = user.follows?(profile) %> + <%= button(:unfollow, content_tag('span', _('Unfollow')), {:profile => profile.identifier, :controller => 'profile', :action => 'unfollow'}, :method => :post, :id => 'action-unfollow', :title => _("Unfollow"), :style => follow ? "" : "display: none;") %> <%= button(:ok, content_tag('span', _('Follow')), {:profile => profile.identifier, :controller => 'profile', :action => 'find_profile_circles'}, :id => 'action-follow', :title => _("Follow"), :style => follow ? "display: none;" : "") %> -
  • -<%end%> + +<% end %> <%= render_environment_features(:profile_actions) %> diff --git a/app/views/followers/_profile_list.html.erb b/app/views/followers/_profile_list.html.erb index eccd097..c33f43a 100644 --- a/app/views/followers/_profile_list.html.erb +++ b/app/views/followers/_profile_list.html.erb @@ -7,7 +7,7 @@ <%= button_without_text :remove, content_tag('span',_('unfollow')), { :controller => "profile", :profile => followed_profile.identifier, :follower_id => profile.id, :action => 'unfollow', :redirect_to => url_for({:controller => "followers", :profile => profile.identifier}) }, - :title => _('remove') %> + :method => :post, :title => _('remove') %> <%= modal_icon_button :edit, _('change category'), url_for(:controller => 'followers', :action => 'set_category_modal', :followed_profile_id => followed_profile.id) %> diff --git a/features/follow_profile.feature b/features/follow_profile.feature index a596382..b9f420e 100644 --- a/features/follow_profile.feature +++ b/features/follow_profile.feature @@ -110,6 +110,5 @@ Feature: follow profile And I am logged in as "johnsnow" When I go to nightswatch's homepage When I follow "Unfollow" - And I wait 1 second Then "johnsnow" should not be a follower of "nightswatch" -- libgit2 0.21.2