add generic #show page for orvos objects and use it for Log and User
[arvados.git] / app / views / application / _orvos_object.html.erb
1 <table class="table topalign">
2   <thead>
3   </thead>
4   <tbody>
5     <% @object.attributes_for_display.each do |attr, attrvalue| %>
6     <% if attrvalue.is_a? Hash then attrvalue.each do |infokey, infocontent| %>
7     <tr>
8       <td><%= infokey %></td>
9       <td>
10         <tt>
11           <% if infocontent.is_a? Array then infocontent.each do |message| %>
12           <%= message %><br />
13           <% end; elsif infocontent.is_a? String %>
14           <%= infocontent %>
15           <% else %>
16           <%= infocontent.inspect %>
17           <% end %>
18         </tt>
19       </td>
20     </tr>
21     <% end %>
22     <% elsif attrvalue.is_a? String or attrvalue.respond_to? :to_s %>
23     <tr>
24       <td><%= attr %></td>
25       <% if attrvalue.is_a? String and (resource_class = OrvosBase::resource_class_for_uuid(attrvalue, attr, @object)) %>
26       <td><%= link_to "#{resource_class.to_s} #{attrvalue}", { controller: resource_class.to_s.camelize(:lower).pluralize, action: 'show', id: attrvalue } %></td>
27       <% else %>
28       <td><%= attrvalue %></td>
29       <% end %>
30     </tr>
31     <% end; end %>
32   </tbody>
33 </table>