<%= javascript 'lookup_keys' %>
<% title _("User Groups") %>

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

<table class="table table-bordered table-striped table-two-pane">
  <thead>
    <tr>
      <th><%= s_("Usergroup|Name") %></th>
      <th><%= _("Users") %></th>
      <th><%= _("User Groups") %></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% for usergroup in @usergroups %>
      <tr>
        <td class="display-two-pane"><%= link_to_if_authorized trunc_with_tooltip(usergroup.name), hash_for_edit_usergroup_path(:id => usergroup.id).merge(:auth_object => usergroup, :authorizer => authorizer) %></td>
        <td><%= h usergroup.users.except_hidden.map(&:login).to_sentence %></td>
        <td><%= h usergroup.usergroups.map(&:name).to_sentence %></td>
        <td>
          <%= display_delete_if_authorized hash_for_usergroup_path(:id => usergroup).merge(:auth_object => usergroup, :authorizer => authorizer),
            :data => { :confirm => (_("Delete %s?") % usergroup.name) } %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @usergroups %>
