2 <h2 class="pull-left"><%= controller.model_class.to_s.pluralize.underscore.capitalize.gsub '_', ' ' %></h2>
4 <% if controller.model_class.creatable? %>
5 <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}",
6 { action: 'create', return_to: request.url },
7 { class: 'btn btn-primary pull-right' } %>
11 <% if @objects.empty? %>
13 <p style="text-align: center">
14 No <%= controller.model_class.to_s.pluralize.underscore.gsub '_', ' ' %> to display.
19 <% attr_blacklist = ' created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %>
21 <table class="table arv-index">
24 <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
25 <% next if attr_blacklist.index(" "+attr) %>
26 <th class="arv-attr-<%= attr %>">
27 <%= controller.model_class.attribute_info[attr.to_sym].andand[:column_heading] or attr.sub /_uuid/, '' %>
31 <!-- a column for delete buttons -->
37 <% @objects.each do |object| %>
39 <% object.attributes_for_display.each do |attr, attrvalue| %>
40 <% next if attr_blacklist.index(" "+attr) %>
41 <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
42 <% if attr == 'uuid' %>
43 <%= link_to_if_arvados_object object %>
44 <%= link_to_if_arvados_object(object, { link_text: raw('<i class="icon-hand-right"></i>') }) %>
46 <% if object.attribute_editable? attr %>
47 <%= render_editable_attribute object, attr %>
49 <%= resource_class_for_uuid(attrvalue, referring_attr: attr, referring_object: @object).to_s %>
52 <%= 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}) %>
57 <% if object.editable? %>
58 <%= link_to({action: 'destroy', id: object.uuid}, method: :delete, data: {confirm: "You are about to delete #{controller.model_class} #{object.uuid}.\n\nAre you sure?"}) do %>
59 <i class="icon-trash"></i>
60 <!-- <%= object.inspect %> -->