<%= javascript_tag do %> function setup_media_change(ele) { if ($(ele).val() == 'spacewalk') { $('[id$="medium_path"]').prop('disabled', true) $('#spacewalk_hostname').prop('disabled', false) } else { $('#spacewalk_hostname').prop('disabled', true) $('[id$="medium_path"]').prop('disabled', false) } } function setup_media_create_change(ele) { $('[id$="medium_id"]').val('') } <% end %> <%= form_for provisioner, :url => step4_update_foreman_setup_provisioner_path, :method => 'PUT' do |f| %> <%= base_errors_for provisioner %> <%= provisioner_wizard 4 %>

<%= _("Some information about the location of installation media for the operating system used for provisioning is now required.") %>

<%= _("If installation media has already been set up, it can be selected below and the wizard will complete the necessary associations. Otherwise use the fields below, or the Installation Media page in Foreman to add new media.") %>

<%= _("Operating system") %>

<%= _("The following operating system will be configured for provisioning:") %>

<%= (icon(f.object.host.os, :size => "18x18") + " #{f.object.host.os}").html_safe %>
<%= _("Use an existing installation medium") %>
<%= f.fields_for :hostgroup do |hgf| %> <%= select_f hgf, :medium_id, Medium.all, :id, :name, {:include_blank => true}, {:label => _("Existing medium")} %> <% end %>
<%= _("Create new installation medium") %>
<%= f.fields_for :create_medium, @medium do |mf| %> <%= text_f mf, :name, :onchange => 'setup_media_create_change(this)' %> <%= label_tag('', :class => 'radio inline') do %> <% radio_button_tag(:medium_type, :path, true, :onchange => 'setup_media_change(this); setup_media_create_change(this)') + _("Normal installation media") %> <% end %> <%= text_f mf, :path, :label => _("Path or URL") %> <%= label_tag('', :class => 'radio inline') do %> <% radio_button_tag(:medium_type, :spacewalk, false, :onchange => 'setup_media_change(this); setup_media_create_change(this)') + _("Red Hat Satellite 5 or Spacewalk") %> <% end %> <%= field(f, :spacewalk_hostname, :label => _("Hostname")) { text_field_tag :spacewalk_hostname, nil, :disabled => true } %> <% end %>

<%= _("Activation key configuration") %>

<%= _("Users of Spacewalk, Red Hat Network, or Red Hat Satellite 5 should enter an appropriate activation key below, otherwise leave blank.") %>

<%= f.fields_for :satellite_type, @satellite_type do |stf| %> <%= selectable_f stf, :value, [['Red Hat Satellite or Spacewalk', 'site'], ['Red Hat Network', 'hosted']], {:include_blank => true}, {:label => _("Type")} %> <% end %> <%= f.fields_for :activation_key, @activation_key do |akf| %> <%= text_f akf, :value, :label => _("Activation key") %> <% end %> <%= submit_or_cancel f, false, {:cancel_path => foreman_setup_provisioners_path, :disabled => !(f.object.host.present? && f.object.smart_proxy.present?)} %> <% end %>