From a19a0d7b9278ae8666971e5f004013ecaa3a9cf8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 5 Sep 2007 17:24:22 +0000 Subject: [PATCH] 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 --- app/models/project.rb | 4 ++++ app/views/layouts/_projects_menu.rhtml | 12 ++++++++++++ app/views/layouts/base.rhtml | 14 ++------------ 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 app/views/layouts/_projects_menu.rhtml 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? %> -- 2.39.5