<div class="row">
  <div class="col-md-8">
    <table class="table table-bordered table-striped">
      <thead>
        <tr>
          <th>
            <%= _("Name") %>
          </th>
          <th>
            <%= _("Host group") %>
          </th>
          <th>
            <%= _("Environment") %>
          </th>
          <%= raw("<th>" + _("Location") + "</th>") if SETTINGS[:locations_enabled]%>
          <%= raw("<th>" + _("Organization") + "</th>") if SETTINGS[:organizations_enabled]%>
        </tr>
      </thead>
      <tbody>
        <% associations = [:hostgroup, :environment] %>
        <% associations << :organization if SETTINGS[:organizations_enabled]  %>
        <% associations << :location     if SETTINGS[:locations_enabled]  %>
        <% hosts.includes(*associations).each do |host| %>
          <tr>
            <td><%=h host %>
            </td>
            <td><%=h host.try(:hostgroup) %></td>
            <td><%=h host.try(:environment) %></td>
            <% if SETTINGS[:locations_enabled]%>
              <td><%=h host.try(:location) %></td>
            <% end %>
            <% if SETTINGS[:organizations_enabled]%>
              <td><%=h host.try(:organization) %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
    </table>
    <%= check_box_tag "keep_selected", "", false, :title => _("Keep selected hosts for a future action") %>
    <%= _('Keep selected hosts for a future action') %><br/><br/>
  </div>
</div>
