<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="22%" class="text-left">实训名称</th>
  <th width="8%">技术平台</th>
  <th width="5%">Fork源</th>
  <th width="10%">Fork原因</th>
  <th width="5%">实践</th>
  <th width="4%">选择</th>
  <th width="6%">状态</th>
  <th width="6%">公开</th>
  <th width="6%">创建者</th>
  <th width="8%"><%= sort_tag('创建于', name: 'created_at', path: admins_shixuns_path) %></th>
  <th width="4%">单测</th>
  <th width="4%">操作</th>
  </thead>
  <tbody>
  <% if shixuns.present? %>
    <% shixuns.each_with_index do |shixun,index| %>
      <tr id="shixun_item_<%= shixun.id %>">
        <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><%= overflow_hidden_span(shixun&.fork_reason, width: 150) %></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 class="shixuns-status-<%= shixun.public %>"><%= shixun_public_status shixun %></td>
        <td><%= link_to shixun.user.try(:real_name),"/users/#{shixun.user.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 %>
            <%= delete_link l(:button_delete), admins_shixun_path(shixun, element: ".shixun-item-#{shixun.id}"), class: 'delete-shixun-action' %>
          <% end %>
        </td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

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