From: Jean-Philippe Lang Date: Wed, 5 Sep 2007 17:24:22 +0000 (+0000) Subject: Subprojects are now grouped by projects in the 'Projects' top navigation drop-down... X-Git-Tag: 0.6.0~179 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a19a0d7b9278ae8666971e5f004013ecaa3a9cf8;p=redmine.git Subprojects are now grouped by projects in the 'Projects' top navigation drop-down menu. git-svn-id: http://redmine.rubyforge.org/svn/trunk@703 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/project.rb b/app/models/project.rb index eeeaa9fd4..2eaa0f733 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -116,6 +116,10 @@ class Project < ActiveRecord::Base def all_custom_fields @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq end + + def <=>(project) + name <=> project.name + end protected def validate diff --git a/app/views/layouts/_projects_menu.rhtml b/app/views/layouts/_projects_menu.rhtml new file mode 100644 index 000000000..3204d5fbc --- /dev/null +++ b/app/views/layouts/_projects_menu.rhtml @@ -0,0 +1,12 @@ + diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 1beb51ca9..acce89d44 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -64,18 +64,8 @@ - <% if User.current.admin? %> - <%= render :partial => 'admin/menu' %> - <% end %> - - <% if User.current.memberships.any? %> - - <% end %> + <%= render(:partial => 'admin/menu') if User.current.admin? %> + <%= render(:partial => 'layouts/projects_menu') if User.current.memberships.any? %>
<% if @project && !@project.new_record? %>