<% 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 table-fixed">
  <thead>
    <tr>
      <th class="col-md-4"><%= s_("Usergroup|Name") %></th>
      <th class="col-md-4"><%= _("Users") %></th>
      <th class="col-md-3"><%= _("User Groups") %></th>
      <th><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @usergroups.each do |usergroup| %>
      <tr>
        <td class="display-two-pane ellipsis"><%= 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 class="ellipsis"><%= usergroup.users.except_hidden.map(&:login).to_sentence %></td>
        <td class="ellipsis"><%= usergroup.usergroups.map(&:name).to_sentence %></td>
        <td>
          <%= action_buttons(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 %>
