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.
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
<main class="moderation-users-index">
|
|
<h2><%= t("moderation.users.index.title") %></h2>
|
|
|
|
<%= render Admin::SearchComponent.new(label: t("moderation.users.index.search_placeholder")) %>
|
|
|
|
<% if @users.present? %>
|
|
<h3><%= page_entries_info @users %></h3>
|
|
|
|
<table id="moderation_users" class="moderation-users">
|
|
<thead>
|
|
<th><%= t("admin.hidden_users.index.user") %></th>
|
|
<th><%= t("admin.actions.actions") %></th>
|
|
</thead>
|
|
<tbody>
|
|
<% @users.each do |user| %>
|
|
<tr>
|
|
<td>
|
|
<%= user.name %>
|
|
</td>
|
|
<td>
|
|
<% if user.hidden? %>
|
|
<%= t("moderation.users.index.hidden") %>
|
|
<% else %>
|
|
<%= render Admin::TableActionsComponent.new(user, actions: []) do |actions| %>
|
|
<%= actions.action(:hide, text: t("moderation.users.index.hide"), method: :put) %>
|
|
<%= actions.action(:block, text: t("moderation.users.index.block"), method: :put) %>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<%= paginate @users %>
|
|
<% end %>
|
|
</main>
|