<% define_admin_breadcrumbs do %>
  <% add_admin_breadcrumb('试题导入') %>
<% end %>

<div class="box search-form-container hack-list-form">
  <%= form_tag(admins_hack_imports_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
    <div class="form-group mr-1">
      <label for="status">状态：</label>
      <% status_options = [['全部', ''], ["公开", true], ["私有", false]] %>
      <%= select_tag(:public, options_for_select(status_options), class: 'form-control') %>
    </div>

    <%= text_field_tag(:sub, params[:sub], class: 'form-control col-12 col-md-2 mr-3', placeholder: '课程名称') %>
    <%= text_field_tag(:name, params[:name], class: 'form-control col-12 col-md-2 mr-3', placeholder: '题目名称') %>
    <%= text_field_tag(:user, params[:user], class: 'form-control col-12 col-md-2 mr-3', placeholder: '用户名') %>


    <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
  <% end %>
  <%= link_to "下载excel模版", down_template_admins_hack_imports_path, class: 'btn btn-default mr-3', target: '_blank'%>
  <%= javascript_void_link '导入数据', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-import-hack-modal'} %>

</div>

<div class="box admin-list-container hack-list-container">
  <%= render partial: 'admins/hack_imports/shared/list', locals: { item_banks: @item_banks } %>
</div>

<%= render partial: 'admins/hack_imports/shared/import_hack_modal' %>
