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.
16 lines
644 B
Plaintext
16 lines
644 B
Plaintext
<span class="js-flag-actions">
|
|
<%= render "shared/flag_actions", flaggable: comment, divider: true %>
|
|
</span>
|
|
|
|
<% if can?(:hide, comment) || can?(:hide, comment.user) %>
|
|
<% if comment.author == current_user %>
|
|
<span class="divider"> • </span>
|
|
<%= button_to t("comments.actions.delete"),
|
|
hide_comment_path(comment),
|
|
method: :put, remote: true, class: "delete-comment", form_class: "delete-comment-form",
|
|
data: { confirm: t("comments.actions.confirm_delete") } %>
|
|
<% else %>
|
|
<%= render Shared::ModerationActionsComponent.new(comment) %>
|
|
<% end %>
|
|
<% end %>
|