2872: Fix bugs, tweak formatting
[arvados.git] / apps / workbench / app / views / pipeline_instances / show.html.erb
1 <% template = PipelineTemplate.find?(@object.pipeline_template_uuid) %>
2 <%= content_for :content_top do %>
3   <h2>
4     <%= render_editable_attribute @object, 'name', nil %>
5   </h2>
6   <% if template %>
7   <blockquote><span class="deemphasize">From template:</span><br />
8     <%= link_to_if_arvados_object template, friendly_name: true %><br />
9     <%= template.description %>
10   </blockquote>
11   <% end %>
12 <% end %>
13
14 <% content_for :tab_line_buttons do %>
15   <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'pipeline_instance[state]' => 'New'),
16       class: 'btn btn-primary',
17       #data: {toggle: :tooltip, placement: :top}, title: 'copy and modify',
18       method: :post,
19       ) do %>
20     Clone and edit <i class="fa fa-fw fa-copy"></i>
21   <% end %>
22
23   <% if @object.state.in? ['New', 'Ready'] %>
24     <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
25         class: 'btn btn-primary run-pipeline-button',
26         method: :patch
27         ) do %>
28       Run <i class="fa fa-fw fa-play"></i>
29     <% end %>
30   <% else %>
31     <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
32       <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
33           class: 'btn btn-primary run-pipeline-button',
34           method: :patch
35           ) do %>
36         Stop <i class="fa fa-fw fa-stop"></i>
37       <% end %>
38     <% elsif @object.state == 'Paused' %>
39       <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
40           class: 'btn btn-primary run-pipeline-button',
41           method: :patch
42           ) do %>
43         Resume <i class="fa fa-fw fa-play"></i>
44       <% end %>
45     <% end %>
46   <% end %>
47 <% end %>
48
49 <% if @object.state.in? %w(RunningOnServer RunningOnClient) %>
50   <% content_for :js do %>
51     setInterval(function(){$('a.refresh').click()}, 15000);
52   <% end %>
53 <% end %>
54
55 <%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.show_pane_list }%>