--- /dev/null
+<div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
+ <%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
+
+ <% user_projects_by_root = User.current.projects.find(:all, :include => :parent, :limit => 20).group_by(&:root) %>
+ <% user_projects_by_root.keys.sort.each do |root| %>
+ <%= link_to root.name, {:controller => 'projects', :action => 'show', :id => root}, :class => "menuItem" %>
+ <% user_projects_by_root[root].sort.each do |project| %>
+ <% next if project == root %>
+ <%= link_to(('» ' + project.name), {:controller => 'projects', :action => 'show', :id => project}, :class => "menuItem") %>
+ <% end %>
+ <% end %>
+</div>
</ul>
</div>
- <% if User.current.admin? %>
- <%= render :partial => 'admin/menu' %>
- <% end %>
-
- <% if User.current.memberships.any? %>
- <div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
- <%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
- <% User.current.memberships.find(:all, :limit => 20).each do |membership| %>
- <%= link_to membership.project.name, {:controller => 'projects',:action => 'show', :id => membership.project }, :class => "menuItem" %>
- <% end %>
- </div>
- <% end %>
+ <%= render(:partial => 'admin/menu') if User.current.admin? %>
+ <%= render(:partial => 'layouts/projects_menu') if User.current.memberships.any? %>
<div id="subcontent">
<% if @project && !@project.new_record? %>