X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/63f9b5374e01394486a07dba4f9a43cfd76707e3..0e7a1577b51111a9d503f21d40582da62c2dd7b9:/apps/workbench/app/views/application/index.html.erb diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb index 0d7657f512..3f312405b5 100644 --- a/apps/workbench/app/views/application/index.html.erb +++ b/apps/workbench/app/views/application/index.html.erb @@ -1,50 +1,24 @@ -<% if @objects.empty? %> - -

- No <%= controller.model_class.to_s.underscore.pluralize.gsub '_', ' ' %> to display. -

+<% content_for :page_title do %> +<%= controller.model_class.to_s.pluralize.underscore.capitalize.gsub('_', ' ') %> +<% end %> -<% else %> +<% content_for :tab_line_buttons do %> -<% attr_blacklist = 'created_at modified_at modified_by_user modified_by_client updated_at' %> + <% if controller.model_class.creatable? %> - - - - <% @objects.first.attributes_for_display.each do |attr, attrvalue| %> - <% next if attr_blacklist.index attr %> - - <% end %> - - - - - <% @objects.each do |object| %> - - <% object.attributes_for_display.each do |attr, attrvalue| %> - <% next if attr_blacklist.index attr %> - - <% end %> - + <% 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} %> + + <% else %> + <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", + { action: 'create', return_to: request.url }, + { class: 'btn btn-primary pull-right' } %> <% end %> - - - -
- <%= attr.sub /_uuid/, '' %> -
- <% 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 %> -
+ <% end %> <% end %> -<% if controller.model_class.creatable? %> -<%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", { action: 'create', return_to: './' }, { class: 'btn btn-primary' } %> -<% end %> +<%= render partial: 'content', layout: 'content_layout', locals: {pane_list: controller.index_pane_list }%>