Files
nairobi/app/views/moderation/users/index.html.erb
Javi Martín 021fef07b6 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.
2021-12-30 15:50:03 +01:00

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>