-<table class="table arv-index">
- <thead>
- <tr>
- <% @objects.first.attributes_for_display.each do |attr, attrvalue| %>
- <% next if attr_blacklist.index attr %>
- <th class="arv-attr-<%= attr %>">
- <%= attr.sub /_uuid/, '' %>
- </th>
- <% end %>
- </tr>
- </thead>
-
- <tbody>
- <% @objects.each do |object| %>
- <tr>
- <% object.attributes_for_display.each do |attr, attrvalue| %>
- <% next if attr_blacklist.index attr %>
- <td class="arv-object-<%= object.class.to_s %> arv-attr-<%= attr %>">
- <% if attr == 'uuid' %>
- <%= link_to_if_arvados_object object %>
- <% elsif object.attribute_editable? attr %>
- <%= render_editable_attribute object, attr %>
- <% else %>
- <%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: @object, with_prefixes: true, with_class_name: true} %>
- <% end %>
- </td>
- <% end %>
- </tr>
+ <% if controller.model_class.name == 'User' %>
+ <%= link_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", setup_user_popup_path,
+ {class: 'btn btn-primary pull-right', :remote => true, 'data-toggle' => "modal",
+ 'data-target' => '#user-setup-modal-window', return_to: request.url} %>
+ <div id="user-setup-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+ <% else %>
+ <%= button_to "Add a new #{controller.controller_name.singularize.humanize.downcase}",
+ { action: 'create' },
+ { class: 'btn btn-primary pull-right' } %>