5365: updated signature for link_to_arvados_object_if_readable
[arvados.git] / apps / workbench / app / views / pipeline_instances / _show_components_editable.html.erb
1 <%
2   input_uuids = []
3   input_pdhs = []
4   @object.components.each do |k, component|
5     next if !component
6     component[:script_parameters].andand.each do |p, tv|
7       if tv.is_a? Hash and !tv[:value].nil? and (tv[:dataclass] == "Collection")
8         if CollectionsHelper.match(tv[:value])
9           input_pdhs << tv[:value]
10         else
11           input_uuids << tv[:value]
12         end
13       end
14     end
15   end
16
17   preload_collections_for_objects input_uuids if input_uuids.any?
18   preload_for_pdhs input_pdhs if input_pdhs.any?
19 %>
20
21 <table class="table pipeline-components-table" style="margin-top: -.1em">
22   <colgroup>
23     <col style="width: 20%" />
24     <col style="width: 20%" />
25     <col style="width: 20%" />
26     <col style="width: 40%" />
27   </colgroup>
28
29   <thead>
30     <tr>
31       <th>
32         component
33       </th><th>
34         script
35       </th><th>
36         parameter
37       </th><th>
38         value
39       </th>
40     </tr>
41   </thead>
42   <tbody>
43     <% @object.components.each do |k, component| %>
44       <% next if !component %>
45       <tr>
46         <td><%= k %></td>
47
48         <td><%= component[:script] %></td>
49
50         <td>script version</td>
51
52         <td>
53           <%= render_pipeline_component_attribute (editable && @object), :components, [k, :script_version], component[:script_version] %>
54         </td>
55       </tr>
56
57       <% component[:script_parameters].andand.each do |p, tv| %>
58         <tr>
59           <td style="border-top: none"></td>
60           <td style="border-top: none"></td>
61
62           <td class="property-edit-row"><%= p %></td>
63           <td class="property-edit-row"><%= render_pipeline_component_attribute (editable && @object), :components, [k, :script_parameters, p.to_sym], tv %></td>
64         </tr>
65       <% end %>
66     <% end %>
67   </tbody>
68 </table>