This way it will be easier to change the behavior of all table actions, like adding ARIA attributes. In the past, when we changed the behavior of the `link_to` method, we had to change all table action classes.
46 lines
1.3 KiB
Plaintext
46 lines
1.3 KiB
Plaintext
<h2><%= t("admin.officials.index.title") %></h2>
|
|
<p><%= t("admin.officials.index.help") %></p>
|
|
|
|
<%= render "admin/shared/user_search", url: search_admin_officials_path %>
|
|
|
|
<% if @officials.any? %>
|
|
<h3><%= page_entries_info @officials %></h3>
|
|
|
|
<table>
|
|
<thead>
|
|
<th scope="col"><%= t("admin.officials.index.name") %></th>
|
|
<th scope="col"><%= t("admin.officials.index.official_position") %></th>
|
|
<th scope="col"><%= t("admin.officials.index.official_level") %></th>
|
|
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
|
|
</thead>
|
|
<tbody>
|
|
<% @officials.each do |official| %>
|
|
<tr>
|
|
<td><%= official.name %></td>
|
|
<td>
|
|
<span class="label level-<%= official.official_level %>">
|
|
<%= official.official_position %>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<%= t("admin.officials.level_#{official.official_level}") %>
|
|
</td>
|
|
<td>
|
|
<%= render Admin::TableActionsComponent.new(
|
|
official,
|
|
actions: [:edit],
|
|
edit_path: edit_admin_official_path(official)
|
|
) %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
|
|
<%= paginate @officials %>
|
|
<% else %>
|
|
<div class="callout primary">
|
|
<%= t("admin.officials.index.no_officials") %>
|
|
</div>
|
|
<% end %>
|