diff --git a/app/views/jobs/_form.html.erb b/app/views/jobs/_form.html.erb index 77d7b4a..57432c3 100644 --- a/app/views/jobs/_form.html.erb +++ b/app/views/jobs/_form.html.erb @@ -1,56 +1,53 @@ <%= 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| %> - <% if @job.errors.any? %> -
-

- <%= pluralize(@job.errors.count, "error") %> - prohibited this host from being saved: -

- - -
- <% end %> - <%= f.text_field :name %> -
- <%= label :job_template, :fileset_id, 'Fileset', class: 'control-label col-xs-4' %> +
+ <%= label :job_template, :fileset_id, 'Fileset', class: 'control-label col-xs-4 required' %>
<%= select_tag(:job_template_fileset_id, options_for_select(Fileset.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', '#', class: 'btn btn-primary', role: 'button' %>
-
- <%= label :job_template, :schedule_id, 'Schedule Time', class: 'control-label col-xs-4' %> -
- <%= select_tag(:job_template_schedule_id, - options_for_select(Schedule.pluck(:name, :id)), - name: 'job_template[schedule_id]', - class: 'form-control' - ) %> -
- -
- <%= link_to 'Add', new_schedule_path, 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(Schedule.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_schedule_path, 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 %> diff --git a/app/views/jobs/show.html.erb b/app/views/jobs/show.html.erb index 077b71a..df05487 100644 --- a/app/views/jobs/show.html.erb +++ b/app/views/jobs/show.html.erb @@ -1,18 +1,22 @@

"<%= @job.name %>" Job Template

Job Attributes

<%= render partial: 'job_details' %>
<%= link_to 'Edit', edit_host_job_path(@host, @job), class: "btn btn-primary", role: "button" %>
+
+ <%= link_to 'Back to host', host_path(@host), + class: "btn btn-success", role: "button" %> +