Merge branch '1968-monitor-disk-usage'
[arvados.git] / apps / workbench / app / views / application / _show_recent.html.erb
1 <% if objects.empty? %>
2 <br/>
3 <p style="text-align: center">
4   No <%= controller.controller_name.humanize.downcase %> to display.
5 </p>
6
7 <% else %>
8
9 <% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at owner_uuid group_class' %>
10
11 <%= render partial: "paging", locals: {results: objects, object: @object} %>
12
13 <%= form_tag do |f| %>
14
15 <table class="table table-condensed arv-index">
16   <thead>
17     <tr>
18       <th></th>
19       <th></th>
20       <% objects.first.attributes_for_display.each do |attr, attrvalue| %>
21       <% next if attr_blacklist.index(" "+attr) %>
22       <th class="arv-attr-<%= attr %>">
23         <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
24       </th>
25       <% end %>
26       <th>
27         <!-- a column for delete buttons -->
28       </th>
29     </tr>
30   </thead>
31       
32   <tbody>
33     <% objects.each do |object| %>
34     <tr data-object-uuid="<%= object.uuid %>">
35       <td>
36         <%= render :partial => "selection_checkbox", :locals => {:object => object} %>
37       </td>
38       <td>
39         <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
40       </td>
41
42       <% object.attributes_for_display.each do |attr, attrvalue| %>
43       <% next if attr_blacklist.index(" "+attr) %>
44       <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
45         <% if attr == 'uuid' %>
46         <span class="arvados-uuid"><%= attrvalue %></span>
47         <% else %>
48         <% if object.attribute_editable? attr %>
49         <%= render_editable_attribute object, attr %>
50         <% else %>
51         <%= resource_class_for_uuid(attrvalue, referring_attr: attr, referring_object: @object).to_s %>
52         <%= attrvalue %>
53         <% end %>
54         <%= 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}) %>
55         <% end %>
56       </td>
57       <% end %>
58       <td>
59         <%= render partial: 'delete_object_button', locals: {object:object} %>
60       </td>
61     </tr>
62     <% end %>
63   </tbody>
64
65   <tfoot>
66   </tfoot>
67 </table>
68
69 <% end %>
70
71 <%= render partial: "paging", locals: {results: objects, object: @object} %>
72
73 <% end %>