From: Anton Khorev Date: Tue, 4 Jun 2024 13:28:26 +0000 (+0300) Subject: Write changeset subscribe/unsubscribe buttons using tag.button X-Git-Tag: live~412^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/289c22daa782a43ee45d61ff421e7a16cb0555fb Write changeset subscribe/unsubscribe buttons using tag.button --- diff --git a/app/views/changesets/show.html.erb b/app/views/changesets/show.html.erb index a30dc8c79..1d37e302a 100644 --- a/app/views/changesets/show.html.erb +++ b/app/views/changesets/show.html.erb @@ -18,9 +18,17 @@ <% if current_user %>
<% if @changeset.subscribers.exists?(current_user.id) %> - + <%= tag.button t("javascripts.changesets.show.unsubscribe"), + :class => "btn btn-sm btn-primary", + :name => "unsubscribe", + :data => { :method => "POST", + :url => api_changeset_unsubscribe_url(@changeset) } %> <% else %> - + <%= tag.button t("javascripts.changesets.show.subscribe"), + :class => "btn btn-sm btn-primary", + :name => "subscribe", + :data => { :method => "POST", + :url => api_changeset_subscribe_url(@changeset) } %> <% end %>
<% end %>