Skip to content

Commit

Permalink
Merge pull request #5509 from AntonKhorev/restore-follows-form
Browse files Browse the repository at this point in the history
Use form with normal-sized button on follows show pages
  • Loading branch information
gravitystorm authored Jan 17, 2025
2 parents 3eccf65 + 84a9d71 commit 8f25c09
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/views/follows/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<h1><%= t(@already_follows ? ".unfollow.heading" : ".follow.heading", :user => @friend.display_name) %></h1>
<% end %>

<%= link_to t(@already_follows ? ".unfollow.button" : ".follow.button"),
follow_path(:display_name => @friend.display_name, :referer => params[:referer]),
:method => (@already_follows ? :delete : :post),
:class => "btn btn-sm btn-primary" %>
<%= bootstrap_form_tag :method => (@already_follows ? :delete : :post) do |f| %>
<% if params[:referer] -%>
<%= f.hidden_field :referer, :value => params[:referer] %>
<% end -%>
<%= f.primary @already_follows ? t(".unfollow.button") : t(".follow.button") %>
<% end %>

0 comments on commit 8f25c09

Please sign in to comment.