<% if records.present? %>
  <% records.each do |record| %>
    <div class="card mb-5">
      <div class="card-header font-16">
        <span><%= record.user.real_name %></span>
        <span class="ml-3"><%= format_time record.created_at %></span>
      </div>

      <div class="mt-2 mb-3 ml-3 font-14">
        <span>实训名称：<%= record.container&.shixun&.name %></span>
        <% if record.container_type == "Challenge" %>
          <span class="ml-3">/</span>
          <span class="ml-3">关卡名：<%= record.container&.subject %></span>
        <% end %>
      </div>

      <div class="diff font-12">
        <ul>
          <% record.diff_record_content&.content&.split("\n").each do |line| %>
            <% if line =~ /^[\+]/ %>
              <li class="ins"><ins><%= line %></ins></li>
            <% elsif line =~ /^[\-]/ %>
              <li class="del"><del><%= line %></del></li>
            <% else %>
              <li class="unchanged"><span><%= line %></span></li>
            <% end %>
          <% end %>
        </ul>
      </div>
    </div>
  <% end %>
<% else %>
  <%= render 'admins/shared/no_data_for_table' %>
<% end %>

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