<% title _("Operating systems") %>
<% title_actions display_link_if_authorized(_("New Operating system"), hash_for_new_operatingsystem_path),
                 documentation_button('4.4.1OperatingSystems') %>

<table class="table table-bordered table-striped table-two-pane">
  <thead>
    <tr>
      <th><%= sort :title, :as => s_("Operatingsystem|Name") %></th>
      <th><%= sort :hosts_count, :as => _("Hosts"), :default => "DESC" %></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% for operatingsystem in @operatingsystems %>
      <tr>
        <td class="display-two-pane"><%= link_to_if_authorized(os_name(operatingsystem), hash_for_edit_operatingsystem_path(:id => operatingsystem).merge(:auth_object => operatingsystem, :authorizer => authorizer)) %></td>
        <td class="ra"><%= link_to operatingsystem.hosts_count, hosts_path(:search => "os_id = #{operatingsystem.id}") %></td>
        <td class="ra">
          <%= display_delete_if_authorized hash_for_operatingsystem_path(:id => operatingsystem).merge(:auth_object => operatingsystem, :authorizer => authorizer),
            :data => { :confirm => _("Delete %s?") % operatingsystem.fullname } %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @operatingsystems %>
