<% title _('Realms') %>
<% title_actions(display_link_if_authorized(_("New Realm"), hash_for_new_realm_path),
                 documentation_button('4.3.8Realm')) %>

<table class="table table-bordered table-striped table-two-pane">
  <thead>
    <tr>
      <th><%= sort :name, :as => s_("Realm|Name") %></th>
      <th><%= sort :hosts_count, :as => _("Hosts"), :default => 'DESC' %></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% for realm in @realms %>
    <tr>
      <td class="display-two-pane"><%= link_to_if_authorized trunc_with_tooltip(realm.name), hash_for_edit_realm_path(:id => realm)%></td>
      <td><%= link_to realm.hosts_count, hosts_path(:search => "realm = #{realm}") %>
      <td><%= display_delete_if_authorized hash_for_realm_path(:id => realm), :data => { :confirm => _("Delete %s?") % realm.name } %></td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @realms %>
