<% if current_user %>
<% if current_user.follows?(model) %>
<%= button_to decidim.follow_path, class: button_classes, params: { follow: { followable_gid: model.to_sgid.to_s, inline: inline? } }, data: { disable: true }, method: :delete, remote: true do %>
<%= icon "bell", icon_options %>
<%= followers_count %>
<%= t("decidim.followers.followers_count", count: followers_count) %>
<%= t("follows.destroy.button", scope: "decidim") %>
<%= render_screen_reader_title_for(model) %>
<% end %>
<% else %>
<%= button_to decidim.follow_path, class: button_classes, params: { follow: { followable_gid: model.to_sgid.to_s, inline: inline? } }, data: { disable: true }, remote: true do %>
<%= icon "bell", icon_options %>
<%= followers_count %>
<%= t("decidim.followers.followers_count", count: followers_count) %>
<% if current_user.follows?(model.try(:participatory_space)) %>
<%= t("follows.create.participatory_space", resource_name: resource_title(model.participatory_space), scope: "decidim") %>
<% else %>
<%= t("follows.create.button", scope: "decidim") %>
<%= render_screen_reader_title_for(model) %>
<% end %>
<% end %>
<% end %>
<% else %>
<%= action_authorized_button_to(
:follow,
decidim.follow_path,
resource: model,
class: button_classes,
params: { follow: { followable_gid: model.to_sgid.to_s, inline: inline? } },
data: { tooltip: true, disable_hover: false },
:'aria-haspopup' => true,
title: t("decidim.shared.follow_button.sign_in_before_follow"),
remote: true) do %>
<%= icon "bell", icon_options %>
<%= followers_count %>
<%= t("decidim.followers.followers_count", count: followers_count) %>
<%= t("follows.create.button", scope: "decidim") %>
<%= render_screen_reader_title_for(model) %>
<% end %>
<% end %>