Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
<div id="hostlist">
<%= link_to_function "Search", toggle_div(:search) %>

<div id="search" style="display:none;">
<% form_for @search do |f|-%>
<%= f.label :name_like, "Name" %>
<%= f.text_field :name_like, :size => 15 %>
<%= f.label :environment_id_equals, "Environment" %>
<%= f.collection_select :environment_id_equals, Environment.all, :id, :name, :include_blank => true %>
<%= f.label :hostgroup, "Role" %>
<%= f.collection_select :hostgroup_id_eq, Hostgroup.all, :id, :name, :include_blank => true %>
<%= render :partial => 'hosts/fact_selected' %>
<p>
<%= f.submit "Search" %>
<% end %>
</div>

<% if hosts.size > 0 -%>
<table class="list">
<caption> <%= header ||= "" -%> </caption>
<tr>
<th><%= order @search, :by => :name %></th>
<th>Operating system</th>
<th>Environment</th>
<th>Model</th>
<th>Host Group</th>
<th><%= order @search, :by => :last_report %></th>
<th>Edit</th>
<th>Delete</th>
</tr>
<% hosts.each do |host| -%>
<tr class="<%= cycle("even", "odd") -%>">
<td><%=name_column(host) %></td>
<td><%=h host.try(:os) %></td>
<td><%=h host.try(:environment) %></td>
<td><%=h host.try(:model) %></td>
<td><%=h host.try(:hostgroup) %></td>
<td><%=last_report_column(host) %></td>
<td><%= link_to 'Edit', edit_host_url(host) %></td>
<td><%= link_to "Destroy", host, :confirm => 'Are you sure?', :method => :delete %></td>
<% end -%>
</tr>
</table>
<% else -%>
<p>No Hosts found</p>
<% end -%>
</div>
<%= page_entries_info hosts %>
<%= will_paginate hosts %>
(5-5/17)