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
This commit is contained in:
parent
afdcd770dc
commit
7514e12d33
|
@ -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|
|
||||
|
|
Loading…
Reference in New Issue