2872: Merge branch 'master' into 2872-folder-nav
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_inputs.html.erb
1 <% n_inputs = 0 %>
2
3 <% content_for :pi_input_form do %>
4 <form role="form" style="width:60%">
5   <div class="form-group">
6     <% @object.components.each do |cname, component| %>
7       <% next if !component %>
8       <% component[:script_parameters].andand.each do |pname, pvalue_spec| %>
9         <% if pvalue_spec.is_a? Hash %>
10           <% if (pvalue_spec[:description] or
11                  ((pvalue_spec[:required] or pvalue_spec[:optional] == false) and
12                   not pvalue_spec[:value])) %>
13             <% n_inputs += 1 %>
14             <label for="<% "#{cname}-#{pname}" %>">
15               <%= pvalue_spec[:title] ||
16                   "\"#{pname.to_s}\" parameter for #{component[:script]} script in #{cname} component" %>
17             </label>
18             <div>
19               <p class="form-control-static">
20                 <%= render_pipeline_component_attribute @object, :components, [cname, :script_parameters, pname.to_sym], pvalue_spec %>
21               </p>
22             </div>
23             <p class="help-block">
24               <%= pvalue_spec[:description] %>
25             </p>
26           <% end %>
27         <% end %>
28       <% end %>
29     <% end %>
30   </div>
31 </form>
32 <% end %>
33
34 <% if n_inputs == 0 %>
35   <p>This pipeline does not need any further inputs specified. You can start it by clicking the "Run" button whenever you're ready. (It's not too late to change existing settings, though.)</p>
36 <% else %>
37   <p><i>Provide <%= n_inputs > 1 ? 'values' : 'a value' %> for the following <%= n_inputs > 1 ? 'parameters' : 'parameter' %>, then click the "Run" button to start the pipeline.</i></p>
38   <%= content_for :pi_input_form %>
39
40   <%= link_to(url_for('pipeline_instance[state]' => 'RunningOnServer'),
41       class: 'btn btn-primary run-pipeline-button',
42       method: :patch
43       ) do %>
44     Run <i class="fa fa-fw fa-play"></i>
45   <% end %>
46
47 <% end %>
48
49 <div style="margin-top: 1em;">
50   <p>Click the "Components" tab above to see a full list of pipeline settings.</p>
51 </div>