<table class="users_table table-content-crud table table-hover table-striped">
  <thead>
  <tr>
    <th class="options"></th>
    <th class="options"></th>
    <% @columns_selected.each do |column| %>
      <th class="<%= "selected" if @order == column %> order-table-head" data-order="<%= column %>" data-orientation="<%= ((@order == column)?  ((@order_orientation == "ASC")? 'DESC' : 'ASC') : 'ASC') %>">
        <%= User.human_attribute_name(column) %>
      </th>
    <% end %>
  </tr>
  </thead>
  <tbody>
  <% @users.each do |user| %>
    <tr>
      <td>
        <% if user.user_admin %>
          <svg title="admin" xmlns="https://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>
      <% end %>
      </td>
      <td>
        <a data-method="post" class="icon-opt" href="<%= impersonate_user_path(user) %>"><i class="icon icon-redo" style="color: #468847;"></i></a>
      </td>
      <% @columns_selected.each do |column| %>
        <td><%= eval("user." + column) %></td>
      <% end %>
    </tr>
  <% end %>

  </tbody>
  <tfoot>
  <tr>
    <td colspan="100%" style="padding-top: 10px;">
      <div class="row" style="max-height: 40px;padding-top: 1px;">
        <div class="col-md-6" style="display: flex">
        </div>
        <div class="col-md-6" align="right">
          <%= t("count") %>: <%= @users.count %> &nbsp;&nbsp;&nbsp;
        </div>
      </div>
    </td>
  </tr>
  </tfoot>
</table>

<style>
  .users_table th:nth-child(3),
  .users_table td:nth-child(3){
    display: none;
  }
</style>
