<%= bootstrap_form_for(@job, url: @job.new_record? ? host_jobs_path : host_job_path(@host, @job), layout: :horizontal, label_col: 'col-xs-4', control_col: 'col-xs-6') do |f| %> <%= f.text_field :name %>
<%= label :job_template, :fileset_id, 'Fileset', class: 'control-label col-xs-4 required' %>
<%= select_tag(:job_template_fileset_id, options_for_select(@host.filesets.pluck(:name, :id)), name: 'job_template[fileset_id]', class: 'form-control' ) %> <% if @job.errors[:fileset_id].present? %> <%= @job.errors[:fileset_id].first %> <% end %>
<%= link_to 'Add', new_host_fileset_path(@host), class: 'btn btn-primary', role: 'button' %>
<% if !@job.restore? %>
<%= label :job_template, :schedule_id, 'Schedule Time', class: 'control-label col-xs-4' %>
<%= select_tag(:job_template_schedule_id, options_for_select(@host.schedules.pluck(:name, :id)), name: 'job_template[schedule_id]', class: 'form-control' ) %> <% if @job.errors[:schedule_id].present? %> <%= @job.errors[:schedule_id].first %> <% end %>
<%= link_to 'Add', new_host_schedule_path(@host), class: 'btn btn-primary', role: 'button' %>
<% end %> <%= f.text_field :restore_location, label: 'Restore Location', placeholder: '/tmp/bacula' %>
<%= f.submit class: "btn btn-success" %>
<% end %>