<table class="table table-hover users-list-table">
  <thead class="thead-light">
  <tr>
    <th width="5%" class="text-center">序号</th>
    <th width="10%">操作类型</th>
    <th width="10%" class="text-left">操作人账号</th>
    <th width="25%" class="text-left">关联基本信息</th>
    <th width="15%">操作时间</th>
    <th width="35%">原因/备注</th>
  </tr>
  </thead>
  <tbody>
  <% if user_actions.present? %>
    <% user_actions.each_with_index do |action, index| %>
      <tr class="user-item-<%= action.user&.id %>">
        <td class="text-center"><%= list_index_no((params[:page] || 1).to_i, index) %></td>
        <td><%= action.action_name %></td>
        <td>
          <%= link_to "/#{action.user&.login}", target: '_blank' do %>
            <%= overflow_hidden_span action.opt_user_name, width: 100 %>
          <% end %></td>
        <td>
          <%=  raw action.action_info %>
        </td>
        <td><%= display_text(action.created_at&.strftime('%Y-%m-%d %H:%M')) %></td>
        <td><%= action.memo %></td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

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