diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index d3f63ede6a..1873191c07 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -41,9 +41,11 @@

<%= page_header_title %>

+ <% if display_main_menu?(@project) %> + <% end %> <%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %> diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 34cea79fa0..4094a9c14e 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -166,6 +166,11 @@ module Redmine render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) end + def display_main_menu?(project) + menu_name = project && !project.new_record? ? :project_menu : :application_menu + Redmine::MenuManager.items(menu_name).size > 1 # 1 element is the root + end + def render_menu(menu, project=nil) links = [] menu_items_for(menu, project) do |node|