8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_tab_buttons.html.erb
1 <% if current_user.andand.is_active %>
2   <% if @object.state.in? ['Complete', 'Failed', 'Cancelled', 'Paused'] %>
3
4   <%= link_to(copy_pipeline_instance_path('id' => @object.uuid, 'script' => "use_latest", "components" => "use_latest", "pipeline_instance[state]" => "RunningOnServer"),
5       class: 'btn btn-primary',
6       title: 'Re-run with latest options',
7       #data: {toggle: :tooltip, placement: :top}, title: 'Re-run',
8       method: :post,
9       ) do %>
10     <i class="fa fa-fw fa-play"></i> Re-run with latest
11   <% end %>
12
13   <%= link_to raw('<i class="fa fa-fw fa-cogs"></i> Re-run options...'),
14       "#",
15       {class: 'btn btn-primary', 'data-toggle' =>  "modal",
16         'data-target' => '#clone-and-edit-modal-window',
17         title: 'Re-run with options'}  %>
18   <% end %>
19
20   <% if @object.state.in? ['New', 'Ready'] %>
21     <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
22         class: 'btn btn-primary run-pipeline-button',
23         title: 'Run this pipeline',
24         method: :patch
25         ) do %>
26       <i class="fa fa-fw fa-play"></i> Run
27     <% end %>
28   <% else %>
29     <% if @object.state.in? ['RunningOnClient', 'RunningOnServer'] %>
30       <%= link_to(cancel_pipeline_instance_path,
31           class: 'btn btn-primary run-pipeline-button',
32           title: 'Pause this pipeline',
33           data: {confirm: 'All unfinished child jobs will be canceled, even if they are being used in another job or pipeline. Are you sure you want to pause this pipeline?'},
34           method: :post
35           ) do %>
36         <i class="fa fa-fw fa-pause"></i> Pause
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           title: 'Resume this pipeline',
42           method: :patch
43           ) do %>
44         <i class="fa fa-fw fa-play"></i> Resume
45       <% end %>
46     <% end %>
47   <% end %>
48 <% end %>