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

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

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

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