Commit 7514e12d authored by Eric Davis's avatar Eric Davis

Hide the main menu div if there isn't any items for it. #3259

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3539 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent afdcd770
......@@ -41,9 +41,11 @@
<h1><%= page_header_title %></h1>
<% if display_main_menu?(@project) %>
<div id="main-menu">
<%= render_main_menu(@project) %>
</div>
<% end %>
</div>
<%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %>
......
......@@ -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|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment