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.
51 lines
1.7 KiB
Plaintext
51 lines
1.7 KiB
Plaintext
<h2><%= t("admin.administrators.index.title") %></h2>
|
|
|
|
<%= render "admin/shared/user_search", url: search_admin_administrators_path %>
|
|
|
|
<div id="administrators">
|
|
<% if @administrators.any? %>
|
|
<h3 class="margin"><%= page_entries_info @administrators %></h3>
|
|
|
|
<table>
|
|
<thead>
|
|
<th scope="col" class="text-center"><%= t("admin.administrators.index.id") %></th>
|
|
<th scope="col"><%= t("admin.administrators.index.name") %></th>
|
|
<th scope="col"><%= t("admin.administrators.index.email") %></th>
|
|
<th scope="col"><%= t("admin.administrators.index.description") %></th>
|
|
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
|
|
</thead>
|
|
<% @administrators.each do |administrator| %>
|
|
<tr id="<%= dom_id(administrator) %>">
|
|
<td class="text-center">
|
|
<%= administrator.id %>
|
|
</td>
|
|
<td>
|
|
<%= administrator.name %>
|
|
</td>
|
|
<td>
|
|
<%= administrator.email %>
|
|
</td>
|
|
<td>
|
|
<%= administrator.description %>
|
|
</td>
|
|
<td>
|
|
<%= link_to t("admin.actions.edit"),
|
|
edit_admin_administrator_path(administrator),
|
|
class: "button hollow" %>
|
|
<%= link_to t("admin.administrators.administrator.delete"),
|
|
admin_administrator_path(administrator),
|
|
method: :delete,
|
|
class: "button hollow alert" %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
|
|
<%= paginate @administrators %>
|
|
<% else %>
|
|
<div class="callout primary margin">
|
|
<%= t("admin.administrators.index.no_administrators") %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|