Project

General

Profile

« Previous | Next » 

Revision 571614ae

Added by Joseph Magen over 9 years ago

fixes #7560 - add :required => true on host fields that have conditional validation if host.managed?

View differences:

app/views/common/os_selection/_architecture.html.erb
:label => _("Operating system"),
:disabled => arch_oss.empty? ? true : false,
:help_inline => :indicator,
:onchange => 'os_selected(this);', :'data-url' => method_path('os_selected')}
:onchange => 'os_selected(this);', :'data-url' => method_path('os_selected'), :required => true}
%>
<% end %>
app/views/common/os_selection/_operatingsystem.html.erb
{:include_blank => blank_or_inherit_f(f, :medium), :selected => item.medium_id},
{:id => type + "_medium_id", :name => type + "[medium_id]", :label => _("Media"), :disabled => os_media.empty?,
:help_inline => :indicator, :onchange => 'medium_selected(this);', :'data-url' => method_path('medium_selected'),
:'data-type' => controller_name }
:'data-type' => controller_name, :required => true }
%>
<%= select_f f, :ptable_id, os_ptable, :id, :to_label,
{:include_blank => blank_or_inherit_f(f, :ptable), :selected => item.ptable_id},
{:id => type + "_ptable_id", :name => type + "[ptable_id]", :label => _("Partition table"), :disabled => os_ptable.empty?}
{:id => type + "_ptable_id", :name => type + "[ptable_id]", :label => _("Partition table"), :disabled => os_ptable.empty?,
:required => true}
%>
<% if @operatingsystem and @operatingsystem.supports_image %>
app/views/hosts/_form.html.erb
{ :include_blank => !@host.managed?, :selected => @organization.try(:id)},
{ :disabled => !@host.new_record?,
:onchange => 'organization_changed(this);', :label => _("Organization"), :'data-host-id' => @host.id,
:'data-url' => process_taxonomy_hosts_path,
:help_inline => :indicator } %>
:'data-url' => process_taxonomy_hosts_path,
:help_inline => :indicator,
:required => SETTINGS[:organizations_enabled] } %>
<% end %>
<% if show_location_tab? %>
......
{ :disabled => !@host.new_record?,
:onchange => 'location_changed(this);', :label => _("Location"), :"data-host-id" => @host.id,
:'data-url' => process_taxonomy_hosts_path, :selected => Location.my_locations,
:help_inline => :indicator } %>
:help_inline => :indicator,
:required => SETTINGS[:locations_enabled] } %>
<% end %>
<%= select_f f, :hostgroup_id, accessible_hostgroups, :id, :to_label,
app/views/hosts/_operating_system.html.erb
<%= select_f f, :architecture_id, Architecture.all, :id, :to_label, {:include_blank => true},
{:onchange => 'architecture_selected(this);', :'data-url' => method_path('architecture_selected'),
:help_inline => :indicator} %>
:help_inline => :indicator, :required => true} %>
<span id="os_select">
<%= render 'common/os_selection/architecture', :item => @host %>
</span>
<div id='provisioning_method' <%= display? (@host.capabilities.size < 2) %> >
<%= field(f, :provision_method, :label => _('Provisioning Method')) do
<%= field(f, :provision_method, :label => _('Provisioning Method'), :required => true) do
radio_button_f(f, :provision_method, :value=>'build', :checked=> @host.pxe_build?, :text=> _("Network Based"), :disabled => !@host.new_record?)+
radio_button_f(f, :provision_method, :value=>'image', :checked=> @host.image_build?, :text=> _("Image Based"), :disabled => !@host.new_record?)
end %>
......
<%= textarea_f f, :disk, :size => "col-md-8", :rows => "4",
:help_block => _("What ever text(or ERB template) you use in here, would be used as your OS disk layout options If you want to use the partition table option, delete all of the text from this field") %>
<%= password_f f, :root_pass, :help_inline => _("Password must be 8 characters or more")%>
<%= password_f f, :root_pass, :help_inline => _("Password must be 8 characters or more"), :required => true %>
</div>
<div id='image_provisioning' <%= display? !@host.image_build? %> >
app/views/hosts/_unattended.html.erb
<div class="tab-pane" id="network">
<%= field_set_tag _("General Settings"), :id => "general_settings" do %>
<%= select_f f, :domain_id, accessible_domains, :id, :to_label, {:include_blank => true},
{:help_inline => :indicator,
{:help_inline => :indicator, :required => true,
:onchange => 'domain_selected(this);', :'data-url' => domain_selected_hosts_path} %>
<%= select_f f, :realm_id, Realm.with_taxonomy_scope_override(@location,@organization).authorized(:view_realms),
......
<%= field_set_tag _("Primary Interface"), :id => "primary_interface" do %>
<div id="mac_address" <%= display? @host.compute_resource_id %> >
<%= text_f f, :mac, :help_inline => _("MAC address for this host"), :autocomplete => 'off' %>
<%= text_f f, :mac, :help_inline => _("MAC address for this host"), :autocomplete => 'off', :required => true %>
</div>
<div id='manage_network'>

Also available in: Unified diff