From a4e659d8e1645d27ebec1c90cd706483cf51f515 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 13 Nov 2014 15:55:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug<=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E6=A8=A1=E5=9D=97=E8=AF=B7=E5=9C=A8=E5=B7=A6?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E5=9C=A8tab=E4=B8=AD=E6=98=BE=E7=A4=BA>=20Signed-off-by:=20ala?= =?UTF-8?q?n=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/redmine/menu_manager.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 0ea1ec79e..b5fec45bc 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -86,9 +86,9 @@ module Redmine end - # Renders the application main menu + # Renders the application main menu def render_main_menu(project) - render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) + render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) end def display_main_menu?(project) @@ -121,12 +121,14 @@ module Redmine return render_menu_node_with_children(node, project) else caption, url, selected = extract_node_details(node, project) + unless url.to_s.include?( 'code_review') return content_tag('li', render_single_menu_node(node, caption, url, selected)) + end end end - def render_menu_node_with_children(node, project=nil) + def render_menu_node_with_children(node, project=nil) caption, url, selected = extract_node_details(node, project) html = [].tap do |html| @@ -170,9 +172,9 @@ module Redmine end def render_single_menu_node(item, caption, url, selected) - unless url.include?('code_review') + link_to(h(caption), url, item.html_options(:selected => selected)) - end + end def render_unattached_menu_item(menu_item, project)