<table class="table table-hover text-center shixuns-list-table">
  <thead class="thead-light">
  <th width="4%">序号</th>
  <th width="8%">ID</th>
  <th width="28%" class="text-left">实训名称</th>
  <th width="8%">技术平台</th>
  <th width="5%">Fork源</th>
  <th width="5%">实践</th>
  <th width="5%">选择</th>
  <th width="6%">状态</th>
  <th width="7%">创建者</th>
  <th width="13%"><%= sort_tag('创建于', name: 'created_on', path: admins_shixuns_path) %></th>
  <th width="5%">单测</th>
  <th width="6%">操作</th>
  </thead>
  <tbody>
  <% if shixuns.present? %>
    <% shixuns.each_with_index do |shixun,index| %>
      <tr>
        <td><%= list_index_no(@params_page.to_i, index) %></td>
        <td><%= shixun.identifier %></td>
        <td class="text-left"><span><%= link_to overflow_hidden_span(shixun.name), "/shixuns/#{shixun.identifier}", :target => "_blank", :title => shixun.name %></span></td>
        <td>
          <%= shixun.shixun_main_name.nil? ? "--" : shixun.shixun_main_name %>
        </td>
        <td>
          <% if shixun.try(:fork_from).nil? %>
            --
          <% else%>
            <%= link_to shixun.try(:identifier), shixun_path(shixun.try(:identifier)), target: '_blank'%>
          <% end%>
        </td>
        <td><%= shixun.challenges.where(:st => 0).size %></td>
        <td><%= shixun.challenges.where(:st => 1).size %></td>
        <td class="shixuns-status-<%= shixun.status %>"><%= shixun_authentication_status shixun %></td>
        <td><%= link_to shixun.owner.try(:real_name),"/users/#{shixun.owner.try(:login)}",target:'_blank' %></td>
        <td><%= format_time shixun.created_at %></td>
        <td class="homepage_teacher">
          <input type="checkbox" name="sigle_show" value="<%= shixun.id %>" <%= shixun.sigle_training ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_teacher_homepage_<%= shixun.id %>">
          <label style="top:-14px;" class="ml20" for="join_teacher_homepage_<%= shixun.id %>"></label>
        </td>
        <td class="operate">
          <% if shixun.status == 0 %>
            <%= link_to(l(:button_delete), admins_shixun_path(shixun), :method => :delete, :data => { confirm: "您确定要删除吗?" } ) %>
          <% end %>
        </td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

<%= render partial: 'admins/shared/paginate', locals: { objects: shixuns } %>