<% define_admin_breadcrumbs do %>
  <% add_admin_breadcrumb('实训配置', admins_shixun_settings_path) %>
<% end %>

<div class="box search-form-container shixun-settings-list-form">
  <%= form_tag(admins_shixun_settings_path, method: :get, class: 'form-inline search-form', remote: true) do %>
    <div class="d-flex flex-column w-100">
      <div class="d-flex position-r">
        <div class="form-group mr-2">
          <label for="status">状态：</label>
          <% status_options = [['全部', ''], ["编辑中(#{@editing_shixuns})", "editing"], ["已发布未公开(#{@processed_shixuns})", 'processed'], ["待审核(#{@pending_public_shixuns})", 'pending'], ["已公开(#{@processed_pubic_shixuns})", 'publiced'], ["已关闭(#{@closed_shixuns})",'closed']] %>
          <%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
        </div>
        <div class="form-group mr-2">
          <label for="tag-choosed">技术平台：</label>
          <%= select_tag(:tag, options_for_select(@shixuns_type_check.unshift(["",nil])), class: 'form-control',id:"settings-tag-choosed") %>
        </div>
        <div class="form-group mr-2">
          <label>搜索类型：</label>
          <% auto_trial_options = [['创建者姓名', 0], ['实训名称', 1], ['学校名称', 2]] %>
          <%= select_tag(:search_type, options_for_select(auto_trial_options), class: 'form-control') %>
        </div>
        <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '输入关键字搜索') %>
        <%= submit_tag('搜索', class: 'btn btn-primary ml-3','data-disable-with': '搜索中...') %>
        <%= link_to "清除",admins_shixun_settings_path,class: "btn btn-default",'data-disable-with': '清除中...' %>
        <div class="">
          <a href="javascript:void(0)" class="btn btn-primary export-base-absolute" id="shixun-settings-base-export" data-disable-with = '导出中...'>导出基础数据</a>
          <a href="javascript:void(0)" class="btn btn-primary export-absolute" id="shixun-settings-export" data-disable-with = '导出中...'>导出</a>
        </div>
      </div>
      <div class="d-flex mt-3">
        <div class="mr-5">
          <label for="can_copy">
            <%= check_box_tag :can_copy,!@sort_json[:can_copy],@sort_json[:can_copy],class:"shixun-settings-select" %>
            <span class="only_view">只看可复制</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="webssh">
            <%= check_box_tag :webssh,(@sort_json[:webssh] == "0" ? "1" : "0"),(@sort_json[:webssh] == "1"), class:"shixun-settings-select" %>
            <span class="only_view">只看可ssh</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="hidden">
            <%= check_box_tag :hidden,!@sort_json[:hidden],@sort_json[:hidden], class:"shixun-settings-select" %>
            <span class="only_view">只看已隐藏</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="homepage_show">
            <%= check_box_tag :homepage_show,!@sort_json[:homepage_show],@sort_json[:homepage_show], class:"shixun-settings-select" %>
            <span class="only_view">只看首页显示</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="task_pass">
            <%= check_box_tag :task_pass, !@sort_json[:task_pass],@sort_json[:task_pass], class:"shixun-settings-select" %>
            <span class="only_view">只看可跳关</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="code_hidden">
            <%= check_box_tag :code_hidden, !@sort_json[:code_hidden],@sort_json[:code_hidden], class:"shixun-settings-select" %>
            <span class="only_view">只看已隐藏文件目录</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="vip">
            <%= check_box_tag :vip, !@sort_json[:vip],@sort_json[:vip], class:"shixun-settings-select" %>
            <span class="only_view">只看vip</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="no_subject">
            <%= check_box_tag :no_subject, !@sort_json[:no_subject],@sort_json[:no_subject], class:"shixun-settings-select" %>
            <span class="only_view">已发布没关联课程</span>
          </label>
        </div>
        <div class="mr-5">
          <label for="to_be_built">
            <%= check_box_tag :to_be_built, !@sort_json[:to_be_built],@sort_json[:to_be_built], class:"shixun-settings-select" %>
            <span class="only_view">只看待建设的</span>
          </label>
        </div>

      </div>
    </div>
  <% end %>
</div>

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

<%= render partial: 'admins/shared/modal/upload_file_modal', locals: { title: '上传图片' } %>