%= form_for provisioner do |f| %>
<%= base_errors_for provisioner %>
<%= provisioner_wizard 1 %>
<%= _("This wizard will help set up Foreman for full host provisioning. Before we begin, a few requirements will be verified.") %>
<%= _("Pre-requisites") %>
<%= f.hidden_field :host_id %>
<% if f.object.host.present? %>
<%= icon_text 'ok', _("Found registered host %s") % f.object.host.name, :kind => 'pficon' %>
<% else %>
<%= icon_text 'error-circle-o', _("Missing registered host %s, please ensure it is checking in") % f.object.fqdn, :kind => 'pficon' %>
<% end %>
<%= f.hidden_field :smart_proxy_id %>
<% if f.object.smart_proxy.present? %>
<%= icon_text 'ok', _("Found registered smart proxy %s") % f.object.smart_proxy.name, :kind => 'pficon' %>
<% else %>
<%= icon_text 'error-circle-o', _("Missing registered smart proxy %s, please ensure it is registered") % f.object.fqdn, :kind => 'pficon' %>
<% end %>
<% if f.object.host.present? && f.object.interfaces.any? %>
<%= icon_text 'ok', _("Host %s has at least one network interface") % f.object.host.name, :kind => 'pficon' %>
<% else %>
<%= icon_text 'error-circle-o', _("No network interfaces listed in $interfaces fact"), :kind => 'pficon' %>
<% end %>
<%= _("Network selection") %>
<% if f.object.host.present? && f.object.interfaces.any? %>
<%= selectable_f f, :provision_interface, f.object.interfaces.map { |i| ["#{i[1][:cidr]} (#{i[0]})", i[0]] }, {}, :label => _("Provisioning network") %>
<% else %>
<%= _("Not available until pre-requisites satisified.") %>
<% end %>
<%= submit_or_cancel f, false, {:cancel_path => foreman_setup_provisioners_path, :disabled => !(f.object.host.present? && f.object.smart_proxy.present?)} %>
<% end %>