Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / application / _show_recent.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% if objects.empty? %>
6 <br/>
7 <p style="text-align: center">
8   No <%= controller.controller_name.humanize.downcase %> to display.
9 </p>
10
11 <% else %>
12
13 <% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at owner_uuid group_class properties' %>
14
15 <%= render partial: "paging", locals: {results: objects, object: @object} %>
16
17 <%= form_tag do |f| %>
18
19 <table class="table table-condensed arv-index">
20   <thead>
21     <tr>
22       <% if objects.first and objects.first.class.goes_in_projects? %>
23         <th></th>
24       <% end %>
25       <th></th>
26       <% objects.first.attributes_for_display.each do |attr, attrvalue| %>
27       <% next if attr_blacklist.index(" "+attr) %>
28       <th class="arv-attr-<%= attr %>">
29         <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
30       </th>
31       <% end %>
32       <th>
33         <!-- a column for user's home -->
34       </th>
35       <th>
36         <!-- a column for delete buttons -->
37       </th>
38     </tr>
39   </thead>
40
41   <tbody>
42     <% objects.each do |object| %>
43     <tr data-object-uuid="<%= object.uuid %>">
44       <% if objects.first.class.goes_in_projects? %>
45         <td>
46           <%= render :partial => "selection_checkbox", :locals => {:object => object} %>
47         </td>
48       <% end %>
49       <td>
50         <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
51       </td>
52
53       <% object.attributes_for_display.each do |attr, attrvalue| %>
54       <% next if attr_blacklist.index(" "+attr) %>
55       <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
56         <% if attr == 'uuid' %>
57           <span class="arvados-uuid"><%= attrvalue %></span>
58         <% else %>
59           <%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: object, with_class_name: true, friendly_name: true} %>
60         <% end %>
61       </td>
62       <% end %>
63       <td>
64         <%= render partial: 'show_home_button', locals: {object:object} %>
65       </td>
66       <td>
67         <%= render partial: 'delete_object_button', locals: {object:object} %>
68       </td>
69     </tr>
70     <% end %>
71   </tbody>
72
73   <tfoot>
74   </tfoot>
75 </table>
76
77 <% end %>
78
79 <%= render partial: "paging", locals: {results: objects, object: @object} %>
80
81 <% end %>