<% title _("Domains") %>

<% title_actions display_link_if_authorized(_("New Domain"), hash_for_new_domain_path), help_path %>

<table class="table table-bordered table-striped table-two-pane">
  <thead>
    <tr>
      <th><%= sort :name, :as => s_("Domain|Fullname") %></th>
      <th><%= sort :hosts_count, :as => _("Hosts"), :default => "DESC" %></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% for domain in @domains %>
    <tr>
      <td class="display-two-pane"><%= link_to_if_authorized trunc_with_tooltip(domain.fullname.empty? ? domain.name : domain.fullname), hash_for_edit_domain_path(:id => domain).merge(:auth_object => domain, :authorizer => authorizer) %></td>
      <td><%= link_to domain.hosts_count, hosts_path(:search => "domain = #{domain}") %>
      <td><%= display_delete_if_authorized hash_for_domain_path(:id => domain).merge(:auth_object => domain, :authorizer => authorizer), :data => { :confirm => _("Delete %s?") % domain.name } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @domains %>
