Files
grecia/app/views/admin/moderators/index.html.erb
Javi Martín 99256adf13 Simplify manager/moderator/admin/official tables
Originally, the code was shared between the index action and the search
action, but since commit fb6dbdf2 that's no longer the case. So in the
index action we don't need to check whether a user is a
moderator/manager/admin/official or not; they all are.
2020-06-16 19:26:05 +02:00

44 lines
1.3 KiB
Plaintext

<%= link_to t("admin.menu.activity"), admin_activity_path, class: "button float-right" %>
<h2 class="inline-block"><%= t("admin.moderators.index.title") %></h2>
<%= render "admin/shared/user_search", url: search_admin_moderators_path %>
<div id="moderators">
<% if @moderators.any? %>
<h3 class="margin"><%= page_entries_info @moderators %></h3>
<table>
<thead>
<th scope="col"><%= t("admin.moderators.index.name") %></th>
<th scope="col" class="small-6"><%= t("admin.moderators.index.email") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead>
<tbody>
<% @moderators.each do |moderator| %>
<tr>
<td>
<%= moderator.name %>
</td>
<td>
<%= moderator.email %>
</td>
<td>
<%= link_to t("admin.moderators.moderator.delete"),
admin_moderator_path(moderator),
method: :delete,
class: "button hollow alert expanded" %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= paginate @moderators %>
<% else %>
<div class="callout primary">
<%= t("admin.moderators.index.no_moderators") %>
</div>
<% end %>
</div>