<%= form_with url: admin_auctions_path, method: :get, html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| %>
<%= f.label :domain %> <%= f.search_field :domain_matches, value: params[:domain_matches], class: 'form-control', placeholder: t(:name) %>
<%= f.label :status %> <%= select_tag :statuses_contains, options_for_select(Auction.statuses.map { |x| [x[0], x[1]] }, params[:q][:status]), { include_blank:true, class: 'form-control' } %>
<%= f.label t(:created_at_from) %> <%= f.search_field :created_at_start, value: params[:created_at_start], class: 'form-control js-datepicker', placeholder: t(:created_at_from) %>
<%= f.label t(:created_at_until) %> <%= f.search_field :created_at_end, value: params[:created_at_end], class: 'form-control js-datepicker', placeholder: t(:created_at_until) %>
<%= label_tag t(:results_per_page) %> <%= text_field_tag :results_per_page_auction, params[:results_per_page_auction], class: 'form-control', placeholder: t(:results_per_page) %>
<%= link_to('Clear', admin_auctions_path, class: 'btn btn-default') %>
<%= link_to 'Download auction list', admin_auctions_path(format: :csv, params: params.permit!), "data-toggle" => "tooltip", "data-placement" => "bottom", "title" => 'Download CSV', class: 'btn btn-primary' %>
<%= link_to "#", class: "btn btn-warning edit", id: 'reserved-modal', data: { toggle: "modal", url: admin_reserved_domains_path, target: "#user-form-edit"} do %> Get reserved domains <% end %> <%= render 'modal' %>
<% end %>

<%= search_form_for [:admin, @q], method: :post, html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| %> <%= label_tag :new_auction %>
<%= text_field_tag :domain, params[:domain], class: 'form-control', placeholder: 'domain name' %> <%= f.submit 'Create', class: 'btn btn-primary', style: 'margin-left: .4rem;', id: 'new-auction-btn' %>
<% end %>
<%= search_form_for @q, url: upload_spreadsheet_admin_auctions_path, method: :post, html: { style: 'margin-bottom: 0; display: flex; flex-direction: row; align-items: center;', class: 'js-form', autocomplete: 'off' } do |f| %> <%= f.file_field :file, accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel", direct_upload: true, style: 'width: 200px;' %> <%= f.submit 'Upload csv', class: 'btn btn-primary' %> <% end %>
<% @auctions.each do |auction| %> <% end %>
<%= sort_link(@q, 'domain') %> <%= sort_link(@q, 'status') %> <%= sort_link(@q, 'created_at') %> <%= sort_link(@q, 'registration_code') %> <%= sort_link(@q, 'registration_deadline') %> <%= sort_link(@q, 'platform', 'Type') %>
<%= colorize_auction(auction) %> <%= auction.status %> <%= auction.created_at %> <%= auction.registration_code %> <%= auction.registration_deadline %> <%= auction.platform.nil? ? 'auto' : auction.platform %> <%= link_to(t(:delete), admin_auction_path(auction), method: :delete, data: { confirm: t(:are_you_sure_you_want_to_delete_auction) }, class: 'btn btn-danger', id: "delete-auction-#{auction.id}") %>
<%= paginate @auctions %>