3894: Merge branch 'master' into 3894-gem-version
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_tab_buttons.html.erb
1   <% if @object.state.in? ['Complete', 'Failed', 'Cancelled', 'Paused'] %>
2
3   <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'script' => "use_latest", "components" => "use_latest", "pipeline_instance[state]" => "RunningOnServer"),
4       class: 'btn btn-primary',
5       #data: {toggle: :tooltip, placement: :top}, title: 'Re-run',
6       method: :post,
7       ) do %>
8     <i class="fa fa-fw fa-play"></i> Re-run with latest
9   <% end %>
10
11   <%= link_to raw('<i class="fa fa-fw fa-cogs"></i> Re-run options'),
12       "#",
13       {class: 'btn btn-primary', 'data-toggle' =>  "modal",
14         'data-target' => '#clone-and-edit-modal-window'}  %>
15   <% end %>
16
17   <% if @object.state.in? ['New', 'Ready'] %>
18     <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
19         class: 'btn btn-primary run-pipeline-button',
20         method: :patch
21         ) do %>
22       <i class="fa fa-fw fa-play"></i> Run
23     <% end %>
24   <% else %>
25     <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
26       <%= link_to(url_for('pipeline_instance[state]' => 'Paused'),
27           class: 'btn btn-primary run-pipeline-button',
28           method: :patch
29           ) do %>
30         <i class="fa fa-fw fa-pause"></i> Pause
31       <% end %>
32     <% elsif @object.state == 'Paused' %>
33       <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
34           class: 'btn btn-primary run-pipeline-button',
35           method: :patch
36           ) do %>
37         <i class="fa fa-fw fa-play"></i> Resume
38       <% end %>
39     <% end %>
40   <% end %>