Advertise filters param in discovery doc.
[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.model_class.to_s.pluralize.underscore.gsub '_', ' ' %> 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' %>
10
11 <table class="table table-condensed arv-index">
12   <thead>
13     <tr>
14       <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
15       <% next if attr_blacklist.index(" "+attr) %>
16       <th class="arv-attr-<%= attr %>">
17         <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
18       </th>
19       <% end %>
20       <th>
21         <!-- a column for delete buttons -->
22       </th>
23     </tr>
24   </thead>
25       
26   <tbody>
27     <% @objects.each do |object| %>
28     <tr data-object-uuid="<%= object.uuid %>">
29       <% object.attributes_for_display.each do |attr, attrvalue| %>
30       <% next if attr_blacklist.index(" "+attr) %>
31       <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
32         <% if attr == 'uuid' %>
33         <%= link_to_if_arvados_object object %>
34         <%= link_to_if_arvados_object(object, { link_text: raw('<i class="icon-hand-right"></i>') }) %>
35         <% else %>
36         <% if object.attribute_editable? attr %>
37         <%= render_editable_attribute object, attr %>
38         <% else %>
39         <%= resource_class_for_uuid(attrvalue, referring_attr: attr, referring_object: @object).to_s %>
40         <%= attrvalue %>
41         <% end %>
42         <%= 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}) %>
43         <% end %>
44       </td>
45       <% end %>
46       <td>
47         <%= render partial: 'delete_object_button', locals: {object:object} %>
48       </td>
49     </tr>
50     <% end %>
51   </tbody>
52
53   <tfoot>
54   </tfoot>
55 </table>
56
57 <% end %>