<%
  define_admin_breadcrumbs do
    add_admin_breadcrumb('竞赛列表', admins_competitions_path)
    add_admin_breadcrumb(@competition.name)
  end
%>

<div class="box search-form-container flex-column mb-0 pb-0 competition-enroll-list-form">
  <ul class="nav nav-tabs w-100 search-form-tabs">
    <li class="nav-item">
      <%= link_to '报名列表', admins_competition_enroll_lists_path(@competition), class: "nav-link search-form-tab active" %>
    </li>
    <li class="nav-item">
      <%= link_to '获奖证书审批', admins_competition_competition_prize_users_path(@competition), class: "nav-link search-form-tab" %>
    </li>
  </ul>

  <div class="d-flex">
    <%= form_tag(admins_competition_enroll_lists_path(unsafe_params), method: :get, class: 'form-inline search-form mt-3 flex-1 d-flex', remote: true) do %>
      <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '战队名称检索') %>
      <%= text_field_tag(:school, params[:school], class: 'form-control col-sm-2 ml-3', placeholder: '队员学校名称检索') %>
      <%= text_field_tag(:location, params[:location], class: 'form-control col-sm-2 ml-3', placeholder: '队员地区检索') %>
      <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
      <%= link_to "清除", admins_competition_enroll_lists_path(@competition), class: "btn btn-default",'data-disable-with': '清除中...' %>
    <% end %>

    <a href="javascript:void(0)" class="btn btn-primary mt-3" id="enroll-lists-export" data-competition-id="<%= @competition.id %>">导出</a>
  </div>
</div>

<div class="box admin-list-container competition-enroll-list-container">
  <%= render(partial: 'admins/enroll_lists/list', locals: { enroll_lists: @enroll_lists }) %>
</div>