Merge branch 'master' of git.clinicalfuture.com:arvados
[arvados.git] / apps / workbench / app / views / application / _show_metadata.html.erb
1 <% outgoing = Link.where(tail_uuid: @object.uuid) %>
2 <% incoming = Link.where(head_uuid: @object.uuid) %>
3
4 <h3>Metadata about this object</h3>
5 <% if outgoing.items_available > 0 %>
6 <table class="table topalign">
7   <thead>
8     <tr>
9       <th>metadata uuid</th>
10       <th>class</th>
11       <th>name</th>
12       <th>properties</th>
13       <th>object</th>
14     </tr>
15   </thead>
16   <tbody>
17     <% outgoing.each do |link| %>
18       <tr>
19         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
20         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
21         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %></td>
22         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
23         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid } %></td>
24       </tr>
25     <% end %>
26   </tbody>
27 </table>
28 <% else %>
29 No metadata.
30 <% end %>
31
32 <h3>Metadata that refers to this object</h3>
33 <% if incoming.items_available > 0 %>
34 <table class="table topalign">
35   <thead>
36     <tr>
37       <th>metadata uuid</th>
38       <th>subject</th>
39       <th>class</th>
40       <th>name</th>
41       <th>properties</th>
42     </tr>
43   </thead>
44   <tbody>
45     <% incoming.each do |link| %>
46       <tr>
47         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
48         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid } %></td>
49         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
50         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %></td>
51         <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
52       </tr>
53     <% end %>
54   </tbody>
55 </table>
56 <% else %>
57 No metadata.
58 <% end %>