Remove popup on follow buttons and remove uneeded code.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-19 17:06:52 +02:00
parent cba497b32e
commit c9a6630c94
7 changed files with 16 additions and 78 deletions

View File

@@ -3,41 +3,23 @@
<% if show_follow_action? followable %>
<%= link_to "##{follow_link_wrapper_id(followable)}",
id: follow_link_wrapper_id(followable),
<%= link_to t('shared.follow'),
follows_path(followable_id: followable.id,
followable_type: followable.class.name),
method: :post, remote: true,
title: follow_text(followable),
data: { toggle: follow_drop_id(followable) },
class: 'button hollow' do %>
<%= t('shared.follow') %>
<% end %>
<div class="dropdown-pane" id="<%= follow_drop_id(followable) %>"
data-dropdown data-auto-focus="true">
<%= link_to follow_text(followable),
follows_path(followable_id: followable.id,
followable_type: followable.class.name),
method: :post, remote: true,
id: follow_link_id(followable) %>
</div>
class: 'button hollow' %>
<% end %>
<% if show_unfollow_action? followable %>
<% follow = followable.follows.where(user: current_user).first %>
<%= link_to "##{unfollow_link_wrapper_id(followable)}",
id: unfollow_link_wrapper_id(followable),
<%= link_to t('shared.unfollow'),
follow_path(follow),
method: :delete, remote: true,
title: unfollow_text(followable),
data: { toggle: unfollow_drop_id(followable) },
class: 'button hollow' do %>
<%= t('shared.unfollow') %>
<% end %>
<div class="dropdown-pane" id="<%= unfollow_drop_id(followable) %>"
data-dropdown data-auto-focus="true">
<%= link_to unfollow_text(followable),
follow_path(follow),
method: :delete, remote: true,
id: unfollow_link_id(followable) %>
</div>
class: 'button hollow' %>
<% end %>