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