|
<% form_for @host do |f| %>
|
|
<%= f.error_messages %>
|
|
|
|
<% field_set_tag 'Primary settings' do -%>
|
|
<table>
|
|
<tr>
|
|
<td>Name</td>
|
|
<td><%= f.text_field :name, :size => 16, :value => @host.shortname %></td>
|
|
<td>Host group</td>
|
|
<td><%= f.collection_select :hostgroup_id, Hostgroup.all, :id, :name, :include_blank => true %></td>
|
|
<td>Environment</td>
|
|
<td><%= f.collection_select :environment_id, Environment.all, :id, :to_label, :include_blank => true %></td>
|
|
<td>Puppetmaster</td>
|
|
<td><%= f.text_field :puppetmaster, :size => 10, :value => @host.puppetmaster %></td>
|
|
<td><%= link_to_function "Additional Classes", toggle_div(:classlist) %></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div id="classlist", style=display:none;>
|
|
<% if @environment -%>
|
|
<%= render 'puppetclasses/class_selection', :obj => @host %>
|
|
<% else -%>
|
|
<b>Please select an Environment first</b>
|
|
<% end -%>
|
|
</div>
|
|
<% end -%>
|
|
|
|
<%= observe_field(:host_environment_id,
|
|
:url => { :action => :environment_selected, :id => @host.id },
|
|
:update => :classlist,
|
|
:with => :environment_id)
|
|
%>
|
|
|
|
<% if SETTINGS[:unattended].nil? or SETTINGS[:unattended] -%>
|
|
<%= render 'unattended', :f => f %>
|
|
<% end -%>
|
|
|
|
<% field_set_tag 'Additional Information' do -%>
|
|
<table>
|
|
<tr>
|
|
<td> <%= f.text_area :comment, :size => "120x5" %></td>
|
|
<% if SETTINGS[:ldap] -%>
|
|
<td>Owned by</td>
|
|
<td>
|
|
<%= f.select :is_owned_by,
|
|
option_groups_from_collection_for_select([ User, Usergroup], :all, :table_name, :id_and_type, :select_title, @host.is_owned_by),
|
|
:include_blank => "select an owner" %>
|
|
</td>
|
|
<% end -%>
|
|
</tr>
|
|
</table>
|
|
<% end -%>
|
|
|
|
<%= render :partial => "common_parameters/parameters", :locals => {:f => f, :type => :host_parameters} %>
|
|
|
|
<p><%= f.submit "Submit" %></p>
|
|
<% end %>
|