<div id="c-users">
  <div id="a-search">
    <%= simple_form_for(:search, url: users_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
      <%= f.input :name_matches, label: "Name", hint: "Use * for wildcard", input_html: { value: params[:search][:name_matches] } %>

      <%= f.input :level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:level] %>
      <%= f.input :min_level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:min_level] %>
      <%= f.input :max_level, collection: User.level_hash.to_a, include_blank: true, selected: params[:search][:max_level] %>

      <%= f.input :can_upload_free, label: "Unrestricted uploads?", collection: [%w[Yes true], %w[No false]], include_blank: true, selected: params[:search][:can_upload_free] %>
      <%= f.input :can_approve_posts, label: "Approver?", collection: [%w[Yes true], %w[No false]], include_blank: true, selected: params[:search][:can_approve_posts] %>
      <%= f.input :is_super_voter, label: "Super voter?", collection: [%w[Yes true], %w[No false]], include_blank: true, selected: params[:search][:is_super_voter] %>

      <%= f.input :order, collection: [["Join date", "date"], ["Name", "name"], ["Upload count", "post_upload_count"], ["Note count", "note_count"], ["Post update count", "post_update_count"]], selected: params[:search][:order] %>
      <%= f.submit "Search" %>
    <% end %>
  </div>
</div>

<%= render "secondary_links" %>

<% content_for(:page_title) do %>
  Search Users - <%= Danbooru.config.app_name %>
<% end %>
