Project

General

Profile

Download (2.55 KB) Statistics
| Branch: | Tag: | Revision:
bfbf7ed8 Lukas Zapletal
<% title _("Puppet classes") %>
cdf02336 Ohad Levy
de19f5b9 Ohad Levy
<% title_actions import_proxy_select(hash_for_import_environments_puppetclasses_path) %>
cdf02336 Ohad Levy
82e47ae0 Amos Benari
<table class="table table-bordered table-striped">
af6e2624 Ohad Levy
<tr>
74e0b0e3 Lukas Zapletal
<th><%= sort :name, :as => s_("Puppetclass|Name") %></th>
fd2e3be1 Lukas Zapletal
<th><%= sort :environment, :as => _("Environments and documentation") %></th>
83683ed0 Tomer Brisker
<th><%= _('Host groups') %></th>
<th><%= sort :total_hosts, :as => _('Hosts'), :default => "DESC" %></th>
846433a7 Stephen Benjamin
<th><%= sort :params_count, :as => _('Parameters'), :default => "DESC" %></th>
<th><%= sort :variables_count, :as => _('Variables'), :default => "DESC" %></th>
d995ecb4 Paul Kelly
<th></th>
af6e2624 Ohad Levy
</tr>
<% for puppetclass in @puppetclasses %>
29972d83 Amos Benari
<tr>
adb487e0 Ori Rabin
<td><%=link_to_if_authorized trunc(puppetclass.name), hash_for_edit_puppetclass_path(:id => puppetclass).merge(:auth_object => puppetclass, :authorizer => authorizer) %></td>
a67b0923 Paul Kelly
<td>
4d4557e9 Joseph Magen
<% puppetclass.environments.uniq.each do |environment| %>
1b3cbe60 Amos Benari
<%= link_to_function environment, 'show_rdoc(this)', :'data-url' => rdoc_classes_path(environment, puppetclass.name) %>
9fd7478e Paul Kelly
<% end %>
</td>
adb487e0 Ori Rabin
<td><%= puppetclass.hostgroups.map {|hg| link_to_if_authorized trunc(hg), hash_for_edit_hostgroup_path(:id=>hg).merge(:auth_object => hg, :authorizer => @hostgroups_authorizer)}.to_sentence.html_safe %></td>
83683ed0 Tomer Brisker
<td> <%= link_to puppetclass.total_hosts, hosts_path(:search => "class = #{puppetclass.name}")%></td>
df471c78 Stephen Benjamin
<td><%= puppetclass.global_class_params_count %> </td>
6895854c Stephen Benjamin
<td><%= puppetclass.lookup_keys_count %> </td>
82e47ae0 Amos Benari
<td>
f7171e0e Dominic Cleal
<%
links = [display_delete_if_authorized(hash_for_puppetclass_path(:id => puppetclass).merge(:auth_object => puppetclass, :authorizer => authorizer), :confirm => _("Delete %s?") % puppetclass.name, :action => :delete)]
links.push(display_link_if_authorized(_('Override all parameters'), hash_for_override_puppetclass_path(:enable => true, :id => puppetclass), :method => :post, :confirm => _("This will set all parameters of the class %s as overridden. Continue?") % puppetclass.name)) if puppetclass.class_params.present? && !overridden?(puppetclass)
links.push(display_link_if_authorized(_('Set parameters to defaults'), hash_for_override_puppetclass_path(:enable => false, :id => puppetclass), :method => :post, :confirm => _("This will reset parameters of the class %s to their default values. Continue?") % puppetclass.name)) if puppetclass.class_params.present? && overridden?(puppetclass)
%>
<%= action_buttons(*links) %>
d995ecb4 Paul Kelly
</td>
af6e2624 Ohad Levy
</tr>
<% end %>
</table>

a783d2c8 ripcurld00d
<%= will_paginate_with_info @puppetclasses %>