##// END OF EJS Templates
Hide the main menu div if there isn't any items for it. #3259...
Eric Davis -
r3425:7514e12d331b
parent child
Show More
@@ -41,9 +41,11
41 41
42 42 <h1><%= page_header_title %></h1>
43 43
44 <% if display_main_menu?(@project) %>
44 45 <div id="main-menu">
45 46 <%= render_main_menu(@project) %>
46 47 </div>
48 <% end %>
47 49 </div>
48 50
49 51 <%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %>
@@ -166,6 +166,11 module Redmine
166 166 render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project)
167 167 end
168 168
169 def display_main_menu?(project)
170 menu_name = project && !project.new_record? ? :project_menu : :application_menu
171 Redmine::MenuManager.items(menu_name).size > 1 # 1 element is the root
172 end
173
169 174 def render_menu(menu, project=nil)
170 175 links = []
171 176 menu_items_for(menu, project) do |node|
General Comments 0
You need to be logged in to leave comments. Login now