<%= javascript 'users', 'password_strength' %>
<% title _("Users") %>

<% title_actions  display_link_if_authorized(_("New User"), hash_for_new_user_path) %>

<table class="table table-bordered table-striped table-two-pane table-fixed">
  <thead>
    <tr>
      <th><%= sort :login, :as => s_("User|Login") %></th>
      <th><%= sort :firstname, :as => s_("User|Firstname")%></th>
      <th><%= sort :lastname, :as => s_("User|Lastname") %></th>
      <th><%= sort :mail, :as => s_("User|Mail") %></th>
      <th><%= sort :admin, :as => s_("User|Admin") %></th>
      <th><%= sort :last_login_on, :as => s_("User|Last login on"), :default => 'DESC' %></th>
      <th><%= _("Authorized by") %></th>
      <th class="col-md-1"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @users.each do |user| %>
      <tr>
        <td class="display-two-pane ellipsis"><%= avatar_image_tag user, :class => "avatar" %> <%=link_to_if_authorized user.login, hash_for_edit_user_path(:id => user).merge(:auth_object => user, :authorizer => authorizer) %></td>
        <td class="ellipsis"><%= user.firstname %></td>
        <td class="ellipsis"><%= user.lastname %></td>
        <td class="ellipsis"><%= user.mail %></td>
        <td><%= checked_icon user.admin? %></td>
        <td class="ellipsis"><%= last_login_on_column(user)%></td>
        <td class="ellipsis"><%= auth_source_column(user)%></td>
        <td><%= action_buttons(display_delete_if_authorized(
          hash_for_user_path(:id => user).merge(:auth_object => user, :authorizer => authorizer),
          :data => { :confirm => _("Delete %s?") % user.name } )) %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @users %>
