foreman/app/views/hostgroups/_form.html.erb @ 5b3879ff
8844f307 | Michael Moll | <%= javascript 'host_edit', 'host_edit_interfaces', 'class_edit', 'lookup_keys' %>
|
|
f591528c | Amos Benari | <%= form_for @hostgroup, :html => {:data => {:id => @hostgroup.try(:id)}} do |f| %>
|
|
05ab4c16 | Ohad Levy | <%= base_errors_for @hostgroup %>
|
|
e5d3f34e | Ohad Levy | ||
82e47ae0 | Amos Benari | <ul class="nav nav-tabs" data-tabs="tabs">
|
|
4d4557e9 | Joseph Magen | <li class="active"><a href="#primary" data-toggle="tab"><%= _('Hostgroup') %></a></li>
|
|
<li><a href="#puppet_klasses" data-toggle="tab"><%= _('Puppet Classes') %></a></li>
|
|||
<% if SETTINGS[:unattended] %>
|
|||
<li><a href="#network" data-toggle="tab"><%= _('Network') %></a></li>
|
|||
<li><a href="#os" data-toggle="tab"><%= _('Operating System') %></a></li>
|
|||
<% end %>
|
|||
e14b6968 | Daniel Lobato | <li><a href="#params" id='params-tab' data-url='<%= current_parameters_hostgroups_path %>' data-url2='<%= puppetclass_parameters_hostgroups_path %>' data-toggle="tab"><%= _('Parameters') %></a></li>
|
|
611f5bff | Amos Benari | <% if show_location_tab? %>
|
|
4d4557e9 | Joseph Magen | <li><a href="#locations" data-toggle="tab"><%= _('Locations') %></a></li>
|
|
611f5bff | Amos Benari | <% end %>
|
|
<% if show_organization_tab? %>
|
|||
4d4557e9 | Joseph Magen | <li><a href="#organizations" data-toggle="tab"><%= _('Organizations') %></a></li>
|
|
611f5bff | Amos Benari | <% end %>
|
|
05ab4c16 | Ohad Levy | </ul>
|
|
<div class="tab-content">
|
|||
82e47ae0 | Amos Benari | <div class="tab-pane active" id="primary">
|
|
e14b6968 | Daniel Lobato | <%= select_f(f, :parent_id, parent_hostgroups, :id, :to_label, {:include_blank => true}, {:label => _('Parent'),
|
|
1bd19611 | Joseph Mitchell Magen | :onchange => 'hostgroup_changed(this);', :'data-url'=> process_hostgroup_hostgroups_path,
|
|
92ea9c3b | Joseph Magen | :help_inline => :indicator }) if show_parent?(@hostgroup) %>
|
|
74e0b0e3 | Lukas Zapletal | <%= text_f f, :name %>
|
|
34897490 | Joseph Magen | <%= select_f f, :environment_id, Environment.all, :id, :to_label, {:include_blank => blank_or_inherit_f(f, :environment)},
|
|
fd2e3be1 | Lukas Zapletal | {:label => _("Environment"), :onchange => 'update_puppetclasses(this);', :"data-url" => environment_selected_hostgroups_path} %>
|
|
34897490 | Joseph Magen | <%= select_f(f, :compute_profile_id, ComputeProfile.visibles, :id, :name,
|
|
{ :include_blank => blank_or_inherit_f(f, :compute_profile) },
|
|||
{ :label => _("Compute profile") }
|
|||
) if ComputeProfile.visibles.any? %>
|
|||
ace6fbad | Ohad Levy | <%= puppet_master_fields f %>
|
|
05ab4c16 | Ohad Levy | </div>
|
|
82e47ae0 | Amos Benari | <div class="tab-pane" id="puppet_klasses">
|
|
4d4557e9 | Joseph Magen | <% if @environment or @hostgroup.environment %>
|
|
05ab4c16 | Ohad Levy | <%= render 'puppetclasses/class_selection', :obj => @hostgroup %>
|
|
4d4557e9 | Joseph Magen | <% else %>
|
|
378c65e5 | Brad Buckingham | <%= alert :class => 'alert-warning', :text => _('Please select an environment first') %>
|
|
4d4557e9 | Joseph Magen | <% end %>
|
|
05ab4c16 | Ohad Levy | </div>
|
|
e5d3f34e | Ohad Levy | ||
82e47ae0 | Amos Benari | <div class="tab-pane" id="network">
|
|
3345d139 | Tomer Brisker | <fieldset>
|
|
<%= select_f f, :domain_id, accessible_domains, :id, :to_label, {:include_blank => blank_or_inherit_f(f, :domain)},
|
|||
{:help_inline => :indicator, :label => _("Domain"),
|
|||
:onchange => 'interface_domain_selected(this);', :'data-url' => method_path('domain_selected') } %>
|
|||
<%= select_f f, :subnet_id, domain_subnets, :id, :to_label,
|
|||
{ :include_blank => domain_subnets.any? ? blank_or_inherit_f(f, :subnet) : _("No subnets") },
|
|||
{ :disabled => domain_subnets.empty?,
|
|||
:data => { :url => SETTINGS[:unattended] ? freeip_subnets_path : '',
|
|||
:subnets => subnets_ipam_data.to_json },
|
|||
:label => _("Subnet"),
|
|||
:help_inline => :indicator } %>
|
|||
<%= select_f f, :realm_id, Realm.with_taxonomy_scope_override(@location,@organization).authorized(:view_realms), :id, :to_label,
|
|||
{:include_blank => blank_or_inherit_f(f, :realm)}, {:label => _("Realm")} %>
|
|||
</fieldset>
|
|||
05ab4c16 | Ohad Levy | </div>
|
|
82e47ae0 | Amos Benari | <div class="tab-pane" id="os">
|
|
05ab4c16 | Ohad Levy | <%= render "common/os_selection/initial", :item=> @hostgroup %>
|
|
4b09e4df | Shlomi Zadok | <%= password_f f, :root_pass, :help_inline => _("Password must be 8 characters or more")%>
|
|
05ab4c16 | Ohad Levy | </div>
|
|
bd46fa41 | Ohad Levy | ||
82e47ae0 | Amos Benari | <div class="tab-pane" id="params">
|
|
2b6605c4 | Ori Rabin | <h4><%= _('Puppet classes parameters') %></h4>
|
|
7acc469b | Amos Benari | <p/>
|
|
<%= render "puppetclasses/classes_parameters", { :obj => @hostgroup } %>
|
|||
8e53b7c9 | Ori Rabin | <p/>
|
|
7acc469b | Amos Benari | <%= render "common_parameters/puppetclasses_parameters", :f => f %>
|
|
<p/>
|
|||
5b3879ff | amirfefer | <h4><%= _('Global host group parameters') %></h4>
|
|
2b6605c4 | Ori Rabin | <p/>
|
|
e14b6968 | Daniel Lobato | <% if @hostgroup.parent.present? %>
|
|
2b6605c4 | Ori Rabin | <%= render "common_parameters/parent_parameter", :f => f %>
|
|
e14b6968 | Daniel Lobato | <% end %>
|
|
<p/>
|
|||
05ab4c16 | Ohad Levy | <%= render "common_parameters/parameters", { :f => f, :type => :group_parameters } %>
|
|
</div>
|
|||
611f5bff | Amos Benari | ||
e14b6968 | Daniel Lobato | <%= render "taxonomies/loc_org_tabs", :f => f, :obj => @hostgroup %>
|
|
05ab4c16 | Ohad Levy | </div>
|
|
bd46fa41 | Ohad Levy | ||
e14b6968 | Daniel Lobato | <%= f.hidden_field :id %>
|
|
05ab4c16 | Ohad Levy | <%= submit_or_cancel f %>
|
|
bd46fa41 | Ohad Levy | <% end %>
|