2872: Merge branch 'master' into 2872-folder-nav
[arvados.git] / apps / workbench / app / views / application / _show_advanced_metadata.html.erb
1 <% outgoing = Link.where(tail_uuid: @object.uuid) %>
2 <% incoming = Link.where(head_uuid: @object.uuid) %>
3
4 <%
5   preload_uuids = []
6   preload_head_uuids = []
7   outgoing.results.each do |link|
8     preload_uuids << link.uuid
9     preload_uuids << link.head_uuid
10     preload_head_uuids << link.head_uuid
11   end
12   preload_collections_for_objects preload_uuids
13   preload_links_for_objects preload_head_uuids
14 %>
15
16 <% if (outgoing | incoming).any? %>
17 <table class="table topalign">
18   <colgroup>
19     <col width="20%" />
20     <col width="10%" />
21     <col width="10%" />
22     <col width="20%" />
23     <col width="20%" />
24     <col width="20%" />
25   </colgroup>
26   <thead>
27     <tr>
28       <th></th>
29       <th>link_class</th>
30       <th>name</th>
31       <th>tail</th>
32       <th>head</th>
33       <th>properties</th>
34     </tr>
35   </thead>
36   <tbody>
37     <% (outgoing | incoming).each do |link| %>
38       <tr>
39         <td>
40           <%= render partial: 'show_object_button', locals: { object: link, size: 'xs' } %>
41           <span class="arvados-uuid"><%= link.uuid %></span>
42         </td>
43         <td><%= link.link_class %></td>
44         <td><%= link.name %></td>
45         <td><%= link.tail_uuid == object.uuid ? 'this' : (render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid, editable: false }) %></td>
46         <td><%= link.head_uuid == object.uuid ? 'this' : (render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid, editable: false }) %></td>
47         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties, editable: false } %></td>
48       </tr>
49     <% end %>
50   </tbody>
51 </table>
52 <% else %>
53 <span class="deemphasize">
54   (No metadata links found)
55 </span>
56 <% end %>