<table class="table table-hover text-center">
  <thead class="thead-light">
  <tr>
    <th width="5%">序号</th>
    <th width="25%" class="text-left">实训名称</th>
    <th width="50%" class="text-left">评论内容</th>
    <th width="10%">评论者</th>
    <th width="10%">评论时间</th>
  </tr>
  </thead>
  <tbody>
  <% if discusses.present? %>
    <% discusses.each_with_index do |discuss, index| %>
      <tr>
        <td><%= (@params_page.to_i - 1) * 20 + index + 1 %></td>
        <% identifier = Game.find_by(challenge_id: discuss.challenge_id, user_id: discuss.user_id)&.identifier %>
        <td class="text-left"><%= link_to discuss.dis.name, "/tasks/#{identifier}", target: '_blank'%></td>
        <td class="text-left content-img"><%= content_safe discuss.content %></td>
        <td><%= link_to discuss.user.show_real_name, "/users/#{discuss.user.login}", target: '_blank' %></td>
        <td><%= format_time discuss.created_at %></td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

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