Merge branch 'master' into 4025-move-project-button-label
[arvados.git] / apps / workbench / app / views / jobs / show.html.erb
1 <% content_for :tab_line_buttons do %>
2     <% if @object.state == "Running" %>
3     <%= form_tag "/jobs/#{@object.uuid}/cancel", style: "display:inline; padding-left: 1em" do |f| %>
4       <%= button_tag "Cancel running job", {class: 'btn btn-sm btn-danger', id: "cancel-job-button"} %>
5     <% end %>
6   <% else %>
7     <%= form_tag '/jobs', style: "display:inline; padding-left: 1em" do |f| %>
8       <% [:script, :script_version, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
9         <%= hidden_field :job, d, :value => @object[d] %>
10       <% end %>
11       <% [:script_parameters, :runtime_constraints].each do |d| %>
12         <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
13       <% end %>
14       <%= button_tag "Re-run same version", {class: 'btn btn-sm btn-primary', id: "re-run-same-job-button", title: 'Re-run job using the same script version as this run'} do %>
15         <i class="fa fa-gear"></i> Re-run same version
16       <% end %>
17     <% end %>
18   <% if @object.respond_to? :supplied_script_version and !@object.supplied_script_version.nil? and !@object.supplied_script_version.empty? and @object.script_version != @object.supplied_script_version%>
19       <%= form_tag '/jobs', style: "display:inline" do |f| %>
20       <% [:script, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
21         <%= hidden_field :job, d, :value => @object[d] %>
22       <% end %>
23       <%= hidden_field :job, :script_version, :value => @object[:supplied_script_version] %>
24       <% [:script_parameters, :runtime_constraints].each do |d| %>
25         <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
26       <% end %>
27       <%= button_tag "Re-run latest version", {class: 'btn btn-sm btn-primary', id: "re-run-latest-job-button", title: 'Re-run job using the latest script version'} do%>
28         <i class="fa fa-gear"></i> Re-run latest version
29       <% end %>
30     <% end %>
31   <% end %>
32 <% end %>
33 <% end %>
34
35 <%= render partial: 'title_and_buttons' %>
36 <%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>