Files
grecia/app/components/debates/mark_featured_action_component.html.erb
Javi Martín 87a5dd8ee5 Use a button to mark debates as featured
As mentioned in commit 5311daadf, there are several reasons to use
buttons in these situations. And, as mentioned in the previous commits,
using buttons instead of links for actions requiring confirmation will
help us test for accessibility issues.
2024-11-08 13:24:23 +01:00

18 lines
817 B
Plaintext

<div class="mark-featured-action">
<% if debate.featured? %>
<%= button_to t("admin.actions.unmark_featured").capitalize,
unmark_featured_debate_path(debate),
method: :put,
data: { confirm: t("admin.actions.confirm_action",
action: t("admin.actions.unmark_featured"),
name: debate.title) } %>
<% else %>
<%= button_to t("admin.actions.mark_featured").capitalize,
mark_featured_debate_path(debate),
method: :put,
data: { confirm: t("admin.actions.confirm_action",
action: t("admin.actions.mark_featured"),
name: debate.title) } %>
<% end %>
</div>