<% school = laboratory&.school %>
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td class="text-left"><%= school&.name || '可控开源社区' %></td>
<td class="text-left">
  <% if laboratory.identifier %>
    <%= link_to laboratory.site, "http://#{laboratory.site}", target: '_blank'  %>
  <% else %>
    --
  <% end %>
</td>
<td>
  <% if school && school.identifier.present? %>
  <% else %>
    --
  <% end %>
</td>
<td class="member-container">
  <div class="laboratory-user">
    <% laboratory.users.each do |user| %>
    <span class="laboratory-user-item laboratory-user-item-<%= user.id %>">
      <%= link_to user.real_name, "/users/#{user.login}", target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } %>
      <%= link_to(admins_laboratory_laboratory_user_path(laboratory, user_id: user.id),
                  method: :delete, remote: true, class: 'ml-1 delete-laboratory-user-action',
                  data: { confirm: '确认删除吗？' }) do %>
        <i class="fa fa-close"></i>
      <% end %>
    </span>
    <% end %>
  </div>
</td>
<td><%= laboratory.created_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
  <%= link_to '设置', admins_laboratory_laboratory_setting_path(laboratory), class: 'action' %>

  <% if school.present? && laboratory.id != 1 %>
    <%= delete_link '删除', admins_laboratory_path(laboratory, element: ".laboratory-item-#{laboratory.id}"), class: 'action' %>
  <% end %>
</td>
