Make action names to block and hide more clear
The `hide` action was calling the `block` method while the `soft_block` action was calling the `hide` method. Combined with the fact that we also have a `block` permission which is used in `ModerateActions` the logic was hard to follow.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
<% if can? :hide, record.author %>
|
||||
<%= raw separator %>
|
||||
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(record.author_id),
|
||||
method: :put, data: { confirm: confirm_hide_author_text } %>
|
||||
<%= link_to t("admin.actions.block_author").capitalize, block_moderation_user_path(record.author_id),
|
||||
method: :put, data: { confirm: confirm_block_author_text } %>
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
@@ -20,8 +20,8 @@ class Shared::ModerationActionsComponent < ApplicationComponent
|
||||
t("admin.actions.confirm_action", action: t("admin.actions.hide"), name: record.human_name)
|
||||
end
|
||||
|
||||
def confirm_hide_author_text
|
||||
t("admin.actions.confirm_action", action: t("admin.actions.hide_author"), name: record.author.name)
|
||||
def confirm_block_author_text
|
||||
t("admin.actions.confirm_action", action: t("admin.actions.block_author"), name: record.author.name)
|
||||
end
|
||||
|
||||
def separator
|
||||
|
||||
Reference in New Issue
Block a user