Merge branch 'master' into 1971-show-image-thumbnails
[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 <%= 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       <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
20       <% next if attr_blacklist.index(" "+attr) %>
21       <th class="arv-attr-<%= attr %>">
22         <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
23       </th>
24       <% end %>
25       <th>
26         <!-- a column for delete buttons -->
27       </th>
28     </tr>
29   </thead>
30       
31   <tbody>
32     <% @objects.each do |object| %>
33     <tr data-object-uuid="<%= object.uuid %>">
34       <td>
35         <%= render :partial => "selection_checkbox", :locals => {:object => object} %>
36       </td>
37
38       <% object.attributes_for_display.each do |attr, attrvalue| %>
39       <% next if attr_blacklist.index(" "+attr) %>
40       <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
41         <% if attr == 'uuid' %>
42         <%= link_to_if_arvados_object object %>
43         <%= link_to_if_arvados_object(object, { link_text: raw('<i class="icon-hand-right"></i>') }) %>
44         <% else %>
45         <% if object.attribute_editable? attr %>
46         <%= render_editable_attribute object, attr %>
47         <% else %>
48         <%= resource_class_for_uuid(attrvalue, referring_attr: attr, referring_object: @object).to_s %>
49         <%= attrvalue %>
50         <% end %>
51         <%= 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}) %>
52         <% end %>
53       </td>
54       <% end %>
55       <td>
56         <%= render partial: 'delete_object_button', locals: {object:object} %>
57       </td>
58     </tr>
59     <% end %>
60   </tbody>
61
62   <tfoot>
63   </tfoot>
64 </table>
65
66 <% end %>
67
68 <%= render partial: "paging", locals: {results: @objects, object: @object} %>
69
70 <% end %>