<%= javascript "jquery.cookie", "host_checkbox" %>

<% assign_selected_hosts_taxonomy_path = (@taxonomy_type == "Location") ? assign_selected_hosts_location_path : assign_selected_hosts_organization_path %>

<%= form_for taxonomy, :url => assign_selected_hosts_taxonomy_path do |f| %>
  <%= base_errors_for taxonomy %>
  <%= wizard_header 3, _("Create %s") % taxonomy.class.name, _("Select Hosts"), _("Assign Selected Hosts") %>
<div class="row">
  <div class="col-md-11">
<table class="table table-bordered table-striped table-condensed" >
  <tr>
    <th class="ca"><%= check_box_tag "check_all", "", false, { :onclick => "toggleCheck()", :title => _("Select All") } %></th>
    <th class=''><%= sort :name %></th>
    <th class="hidden-xs"><%= sort :os, :as => _("Operating system") %></th>
    <th class="hidden-xs"><%= sort :environment %></th>
    <th class="hidden-tablet hidden-xs"><%= sort :model %></th>
    <th class="hidden-tablet hidden-xs"><%= sort :hostgroup, :as => _("Host group") %></th>
  </tr>
  <% hosts.each do |host| %>
    <tr>
      <td class="ca">
        <%= f.check_box(:host_ids, {:label => "", :help_inline => "", :multiple => true, :onclick => 'hostChecked(this)', :id => "host_ids_#{host.id}", :class => 'host_select_boxes', }, host.id) %>
      </td>
      <td><%= name_column(host) %> </td>
      <td class="hidden-xs"><%= (icon(host.os, :size => "18x18") + trunc(" #{host.os.to_label}",14)).html_safe if host.os %></td>
      <td class="hidden-xs"><%= trunc(host.try(:environment), 14) %></td>
      <td class="hidden-tablet hidden-xs"><%= model_name host %></td>
      <td class="hidden-tablet hidden-xs"><%= hostgroup_name host.hostgroup, 26 %></td>
    </tr>
  <% end %>
</table>

  <%= page_entries_info hosts, :more => " - "+_("<b class='select_count'>0</b> selected") %>
  <%= will_paginate hosts %>
  </div>
</div>
  <%= content_tag(:div, :class => "form-actions") do %>
    <%= link_to(_("Cancel"), "#{controller_name}_path", :class => "btn btn-default") %>
    <%= f.submit(_("Assign to %s") % @taxonomy_type, :class => "btn btn-success") %>
  <% end %>

<% end %>
