[ARVADOS] created: 97e018a1a8b9d4da6c99a9eb7be36a7f368615f9
git at public.curoverse.com
git at public.curoverse.com
Thu Feb 4 10:21:40 EST 2016
at 97e018a1a8b9d4da6c99a9eb7be36a7f368615f9 (commit)
commit 97e018a1a8b9d4da6c99a9eb7be36a7f368615f9
Author: radhika <radhika at curoverse.com>
Date: Thu Feb 4 10:21:00 2016 -0500
8183: show only toplevel projects in the Projects dropdown in breadcrumbs.
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index db3d430..ace9276 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -833,6 +833,12 @@ class ApplicationController < ActionController::Base
{collections: c, owners: own}
end
+ helper_method :my_toplevel_projects
+ def my_toplevel_projects
+ @my_toplevel_projects ||= Group.
+ filter([['group_class','=','project'], ['owner_uuid', '=', current_user.uuid]]).order('name')
+ end
+
helper_method :my_project_tree
def my_project_tree
build_project_trees
diff --git a/apps/workbench/app/views/application/_projects_tree_menu.html.erb b/apps/workbench/app/views/application/_projects_tree_menu.html.erb
index 77b9d45..8139bea 100644
--- a/apps/workbench/app/views/application/_projects_tree_menu.html.erb
+++ b/apps/workbench/app/views/application/_projects_tree_menu.html.erb
@@ -1,4 +1,4 @@
-<li role="presentation" class="dropdown-header">
+<li role="presentation" class="dropdown-header" title="Toplevel projects">
My projects
</li>
<li>
@@ -6,11 +6,10 @@
<span style="padding-left: 0">Home</span>
<% end %>
</li>
-<% my_project_tree.each do |pnode| %>
- <% next if pnode[:object].class != Group %>
+<% my_toplevel_projects.each do |pnode| %>
<li>
- <%= project_link_to.call pnode do %>
- <span style="padding-left: <%= pnode[:depth] %>em"></span><%= pnode[:object].name %>
+ <%= project_link_to.call({object: pnode, depth: 1}) do %>
+ <span style="padding-left: 1em"></span><%= pnode[:name] %>
<% end %>
</li>
<% end %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list