<h2><%= t("admin.officials.index.title") %></h2>

<%= render 'admin/shared/user_search', url: search_admin_officials_path %>

<h3><%= page_entries_info @officials %></h3>

<table>
  <% @officials.each do |official| %>
    <tr>
      <td>
        <%= link_to official.name, edit_admin_official_path(official) %>
      </td>
      <td>
        <span class="label round level-<%= official.official_level %>">
          <%= official.official_position %>
        </span>
        (<%= t("admin.officials.level_#{official.official_level}") %>)
      </td>
      <td class="text-right">
        <%= link_to official.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"),
                    edit_admin_official_path(official), class: "button hollow" %>
      </td>
    </tr>
  <% end %>
</table>

<%= paginate @officials %>
