4084: Missing files.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 22 Oct 2014 20:44:53 +0000 (16:44 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 22 Oct 2014 20:44:53 +0000 (16:44 -0400)
apps/workbench/app/views/jobs/_show_job_buttons.html.erb [new file with mode: 0644]
apps/workbench/app/views/jobs/_show_job_component.html.erb [new file with mode: 0644]

diff --git a/apps/workbench/app/views/jobs/_show_job_buttons.html.erb b/apps/workbench/app/views/jobs/_show_job_buttons.html.erb
new file mode 100644 (file)
index 0000000..644da77
--- /dev/null
@@ -0,0 +1,29 @@
+<% if @object.state != "Running" %>
+    <%= form_tag '/jobs', style: "display:inline; padding-left: 1em" do |f| %>
+      <% [:script, :script_version, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
+        <%= hidden_field :job, d, :value => @object[d] %>
+      <% end %>
+      <% [:script_parameters, :runtime_constraints].each do |d| %>
+        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
+      <% end %>
+      <%= button_tag ({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 %>
+        <i class="fa fa-fw fa-gear"></i> Re-run same version
+      <% end %>
+    <% end %>
+  <% 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%>
+      <%= form_tag '/jobs', style: "display:inline" do |f| %>
+      <% [:script, :repository, :supplied_script_version, :nondeterministic].each do |d| %>
+        <%= hidden_field :job, d, :value => @object[d] %>
+      <% end %>
+      <%= hidden_field :job, :script_version, :value => @object[:supplied_script_version] %>
+      <% [:script_parameters, :runtime_constraints].each do |d| %>
+        <%= hidden_field :job, d, :value => JSON.dump(@object[d]) %>
+      <% end %>
+      <%= button_tag ({class: 'btn btn-sm btn-primary', id: "re-run-latest-job-button",
+                       title: 'Re-run job using the latest script version'}) do%>
+        <i class="fa fa-fw fa-gear"></i> Re-run latest version
+      <% end %>
+    <% end %>
+  <% end %>
+<% end %>
diff --git a/apps/workbench/app/views/jobs/_show_job_component.html.erb b/apps/workbench/app/views/jobs/_show_job_component.html.erb
new file mode 100644 (file)
index 0000000..6ec6c7f
--- /dev/null
@@ -0,0 +1,6 @@
+<% pj = {} %>
+<% pj[:job] = @object %>
+<% pj[:name] = @object[:name] || "this job" %>
+<% pj[:progress_bar] = render(partial: "job_progress", locals: {:j => @object }) %>
+<% tasks = JobTask.filter([['job_uuid', '=', @object.uuid]]).results %>
+<%= render partial: 'pipeline_instances/running_component', locals: {tasks: tasks, pj: pj, i: 0, expanded: true} %>