<% title _("Hardware Models") %>

<% title_actions display_link_if_authorized(_("New Model"), hash_for_new_model_path) %>

<table class="table table-bordered table-striped table-two-pane">
  <thead>
    <tr>
      <th><%= sort :name, :as => s_("Model|Name") %></th>
      <th><%= sort :vendor_class, :as => _("Vendor class") %></th>
      <th><%= sort :hardware_model, :as => s_("Model|Hardware model") %></th>
      <th><%= sort :hosts_count, :as => _("Hosts"), :default => "DESC" %></th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% for model in @models %>
      <tr>
        <td class="display-two-pane"><%=link_to_if_authorized trunc_with_tooltip(model.name), hash_for_edit_model_path(:id => model).merge(:auth_object => model, :authorizer => authorizer) %></td>
        <td><%=h(model.vendor_class)%></td>
        <td><%=h(model.hardware_model)%></td>
        <td class="ra"><%= link_to model.hosts_count, hosts_path(:search => "model = \"#{model}\"") %></td>
        <td class="ra">
          <%= display_delete_if_authorized hash_for_model_path(:id => model).merge(:auth_object => model, :authorizer => authorizer),
                                           :confirm => _("Delete %s?") % model.name %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
<%= will_paginate_with_info @models %>
