The main obstacle to extract this partial was probably the paths for the flag and unflag actions. Now that we use Rails 5.1 `resolve` method to handle nested resources, we can use `polymorphic_path`. Also note the code is a bit ugly because comments render a divider. We should probably use a CSS border instead. Co-Authored-By: taitus <sebastia.roig@gmail.com>
18 lines
720 B
Plaintext
18 lines
720 B
Plaintext
<span class="js-flag-actions">
|
|
<%= render "shared/flag_actions", flaggable: comment, divider: true %>
|
|
</span>
|
|
|
|
<span class="js-moderation-actions">
|
|
<% if can? :hide, comment %>
|
|
<span class="divider"> • </span>
|
|
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment),
|
|
method: :put, remote: true, data: { confirm: t("admin.actions.confirm") } %>
|
|
<% end %>
|
|
|
|
<% if can? :hide, comment.user %>
|
|
<span class="divider"> • </span>
|
|
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(comment.user_id),
|
|
method: :put, data: { confirm: t("admin.actions.confirm") } %>
|
|
<% end %>
|
|
</span>
|