7effb1e97de53ebcc0cfa23ff5ab87e6ac48e4f1
[arvados.git] / apps / workbench / app / views / application / _arvados_object_attr.html.erb
1 <% if attrvalue.is_a? Hash then attrvalue.each do |infokey, infocontent| %>
2 <tr class="info">
3   <td><%= attr %>[<%= infokey %>]</td>
4   <td>
5     <tt>
6       <% if infocontent.is_a? Array and infocontent.collect(&:class).uniq.compact == [String] then infocontent.each do |message| %>
7       <%= message %><br />
8       <% end; elsif infocontent.is_a? String %>
9       <%= infocontent %>
10       <% else %>
11       <%= infocontent.inspect %>
12       <% end %>
13     </tt>
14   </td>
15 </tr>
16 <% end %>
17 <% elsif attrvalue.is_a? String or attrvalue.respond_to? :to_s %>
18 <tr class="<%= 'info' if %w(uuid owner_uuid created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at).index(attr.to_s).nil? %>">
19   <td><%= attr %></td>
20   <td>
21     <% if attr == 'uuid' and (uuid = attrvalue.split('-')).size == 3 %>
22     <%= uuid[0..-2].join('-') %>-<b><%= uuid[-1] %></b>
23     <% elsif @object.attribute_editable?(attr) %>
24     <%= render_editable_attribute @object, attr %>
25     <% else %>
26     <%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: @object, with_class_name: true} %>
27     <% end %>
28     <%= link_to_if_arvados_object(attrvalue, { referring_object: @object, link_text: raw('<i class="icon-hand-right"></i>') }) if resource_class_for_uuid(attrvalue, {referring_object: @object}) %>
29   </td>
30 </tr>
31 <% end %>