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

<%= form_for(User.new, url: search_admin_officials_path, as: :user, method: :get) do |f| %>
  <div class="row">
    <div class="small-12 medium-6 column">
      <%= text_field_tag :name_or_email, "", placeholder: t("admin.officials.index.search_placeholder") %>
    </div>
    <div class="small-12 medium-6 column">
      <%= f.submit t("admin.officials.search.search"), class: "button radius success" %>
    </div>
  </div>
<% end %>

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

<ul class="admin-list">
  <% @users.each do |user| %>
    <li>
      <%= link_to user.name, edit_admin_official_path(user) %>
      <span class="bullet">&nbsp;&bull;&nbsp;</span>
      <span class="label round level-<%= user.official_level %>">
        <%= user.official_position %>
      </span>
      <span class="bullet">&nbsp;&bull;&nbsp;</span>
      <span class="level"><%= t("admin.officials.level_#{user.official_level}") %></span>

    <%= link_to user.official? ? t("admin.officials.search.edit_official") : t("admin.officials.search.make_official"), edit_admin_official_path(user), class: "button radius tiny right" %>
    </li>
  <% end %>
</ul>
