Merge branch 'master' into 4638-ssh-notification
[arvados.git] / apps / workbench / app / views / pipeline_instances / show.html.erb
index f43369f7e2a1a956fdc54c4b76ef02a750f6199a..860e8091b26dd2780974748c145d265ef174cc16 100644 (file)
@@ -1,58 +1,30 @@
 <% template = PipelineTemplate.find?(@object.pipeline_template_uuid) %>
 <%= content_for :content_top do %>
-  <h2>
-    <%= render_editable_attribute @object, 'name', nil %>
-  </h2>
-  <% if template %>
-  <blockquote><span class="deemphasize">From template:</span><br />
-    <%= link_to_if_arvados_object template, friendly_name: true %><br />
-    <%= template.description %>
-  </blockquote>
-  <% end %>
+  <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 %>
+      </div>
+    <% end %>
+  </div>
 <% end %>
 
 <% content_for :tab_line_buttons do %>
 
-  <% if @object.state.in? ['Complete', 'Failed', 'Cancelled'] %>
-
-  <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'script' => "use_latest", "components" => "use_latest", "pipeline_instance[state]" => "RunningOnServer"),
-      class: 'btn btn-primary',
-      #data: {toggle: :tooltip, placement: :top}, title: 'Re-run',
-      method: :post,
-      ) do %>
-    <i class="fa fa-fw fa-play"></i> Re-run with latest
-  <% end %>
-
-  <%= link_to raw('<i class="fa fa-fw fa-cogs"></i> Re-run options'),
-      "#",
-      {class: 'btn btn-primary', 'data-toggle' =>  "modal",
-        'data-target' => '#clone-and-edit-modal-window'}  %>
-  <% end %>
+  <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.state.in? ['New', 'Ready'] %>
-    <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
-        class: 'btn btn-primary run-pipeline-button',
-        method: :patch
-        ) do %>
-      <i class="fa fa-fw fa-play"></i> Run
-    <% end %>
-  <% else %>
-    <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
-      <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
-          class: 'btn btn-primary run-pipeline-button',
-          method: :patch
-          ) do %>
-        <i class="fa fa-fw fa-pause"></i> Pause
-      <% end %>
-    <% elsif @object.state == 'Paused' %>
-      <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
-          class: 'btn btn-primary run-pipeline-button',
-          method: :patch
-          ) do %>
-        <i class="fa fa-fw fa-play"></i> Resume
-      <% end %>
-    <% end %>
-  <% end %>
 <% end %>
 
 <%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>