5135: Workbench consistently orders modal buttons.
[arvados.git] / apps / workbench / app / views / pipeline_instances / show.html.erb
index 900075084da45e2d816ed742f93247880176c05b..e23e49c05ba3f883440e5c73112ce5204fcf1a1e 100644 (file)
@@ -1,72 +1,73 @@
-<% content_for :css do %>
-table.pipeline-components-table thead th {
-  text-align: bottom;
-}
-table.pipeline-components-table div.progress {
-  margin-bottom: 0;
-}
-<% end %>
-<br />
-
-<table class="table pipeline-components-table">
-  <colgroup>
-    <col width="15%" />
-    <col width="15%" />
-    <col width="35%" />
-    <col width="35%" />
-  </colgroup>
-  <thead>
-    <tr>
-      <th>
-        component
-      </th><th>
-        progress
-        <%= link_to '(refresh)', request.fullpath, class: 'refresh', remote: true, method: 'get' %>
-      </th><th>
-        script, version
-      </th><th>
-        output
-      </th>
-    </tr>
-  </thead>
-  <tbody>
-    <% render_pipeline_jobs.each do |pj| %>
-    <tr>
-      <td>
-        <% if pj[:job].andand[:uuid] %>
-        <%= link_to pj[:name], job_url(id: pj[:job][:uuid]) %>
-        <% else %>
-        <%= pj[:name] %>
+<% template = PipelineTemplate.find?(@object.pipeline_template_uuid) %>
+<%= content_for :content_top do %>
+  <div class="row">
+    <div class="col-sm-6">
+      <%= render partial: 'name_and_description' %>
+    </div>
+    <% if template %>
+      <div class="alert alert-info col-sm-6">
+        This pipeline was created from the template <%= link_to_if_arvados_object template, friendly_name: true %><br />
+        <% if template.modified_at && (template.modified_at > @object.created_at) %>
+        Note: This template has been modified since this instance was created.
         <% end %>
-      </td><td>
-        <%= pj[:progress_bar] %>
-        <% if pj[:job].andand[:cancelled_at] %>
-        <span class="pull-right label label-warning">cancelled</span>
-        <% elsif pj[:failed] %>
-        <span class="pull-right label label-warning">failed</span>
-        <% elsif pj[:result] == 'queued' %>
-        <span class="pull-right label">queued</span>
-        <% end %>
-      </td><td>
-        <%= pj[:script] %>
-        <br /><span class="deemphasize"><%= pj[:script_version] %></span>
-      </td><td>
-        <%= link_to_if_arvados_object pj[:output] %>
-      </td>
-    </tr>
+      </div>
     <% end %>
-  </tbody>
-  <tfoot>
-    <tr><td colspan="4"></td></tr>
-  </tfoot>
-</table>
+  </div>
+<% end %>
 
-<div style="height: 1em"></div>
+<% content_for :tab_line_buttons do %>
 
-<%= render partial: 'arvados_object' %>
+  <div id="pipeline-instance-tab-buttons"
+       class="pane-loaded arv-log-event-listener arv-refresh-on-state-change"
+       data-pane-content-url="<%= url_for(params.merge(tab_pane: "tab_buttons")) %>"
+       data-object-uuid="<%= @object.uuid %>"
+       >
+    <%= render partial: 'show_tab_buttons', locals: {object: @object}%>
+  </div>
 
-<% if @object.active %>
-<% content_for :js do %>
-setInterval(function(){$('a.refresh').click()}, 30000);
-<% end %>
 <% end %>
+
+<%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>
+
+<div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
+     aria-labelledby="myModalLabel" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content">
+
+    <%= form_tag copy_pipeline_instance_path do |f| %>
+
+      <div class="modal-header">
+        <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <div>
+          <div class="col-sm-6"> <h4 class="modal-title">Re-run pipeline</h4> </div>
+        </div>
+        <br/>
+      </div>
+
+      <div class="modal-body">
+              <%= radio_button_tag(:script, "use_latest", true) %>
+              <%= label_tag(:script_use_latest, "Use latest script versions") %>
+              <br>
+              <%= radio_button_tag(:script, "use_same") %>
+              <%= label_tag(:script_use_same, "Use same script versions as this run") %>
+              <br>
+              <% if template %>
+              <br>
+              <%= radio_button_tag(:components, "use_latest", true) %>
+              <%= label_tag(:components_use_latest, "Update components against template") %>
+              <br>
+              <%= radio_button_tag(:components, "use_same") %>
+              <%= label_tag(:components_use_same, "Use same components as this run") %>
+              <% end %>
+      </div>
+
+      <div class="modal-footer">
+        <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+        <button type="submit" class="btn btn-primary" name="pipeline_instance[state]" value="RunningOnServer">Run now</button>
+        <button type="submit" class="btn btn-primary" name="pipeline_instance[state]" value="New">Copy and edit inputs</button>
+      </div>
+
+    </div>
+    <% end %>
+  </div>
+</div>