<table class="table table-hover users-list-table">
  <thead class="thead-light">
  <tr>
    <th width="5%">序号</th>
    <th width="10%" class="text-left">真实姓名</th>
    <th width="15%">提交时间</th>
    <th width="15%"><%= sort_tag('最后登录', name: 'last_login_on', path: admins_users_path) %></th>
    <th width="10%">评分</th>
    <th width="45%">意见反馈</th>
  </tr>
  </thead>
  <tbody>
  <% if user_nps.present? %>
    <% user_nps.each_with_index do |nps, index| %>
      <tr class="user-item-<%= nps.user.nil? ? "用户已注销" : nps.user.id %>">
        <td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
        <td class="text-left">
          <%= link_to "/#{nps.user.nil? ? "用户已注销" : nps.user.login}", target: '_blank' do %>
            <%= overflow_hidden_span (nps.user.nil? ? "用户已注销" : nps.user.real_name), width: 100 %>
          <% end %>
        </td>
        <td><%= display_text(nps.created_at&.strftime('%Y-%m-%d %H:%M')) %></td>
        <td><%= display_text(nps.user.nil? ? "用户已注销" : nps.user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %></td>
        <td><%= nps.action_type == 'close' ? '--' : nps.score %></td>
        <td><%= nps.memo %></td>
      </tr>
    <% end %>
  <% else %>
    <%= render 'admins/shared/no_data_for_table' %>
  <% end %>
  </tbody>
</table>

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