From: Go MAEDA Date: Fri, 22 Jul 2022 01:33:38 +0000 (+0000) Subject: Open Help in a separate tab (#1069). X-Git-Tag: 5.1.0~497 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3164895f6995d4255e9ed4c64c25ac07fdc5dd8f;p=redmine.git Open Help in a separate tab (#1069). Contributed by Vijay Kiran. git-svn-id: https://svn.redmine.org/redmine/trunk@21737 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 8114ff9e0..0a1f2ae38 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -115,7 +115,7 @@ diff --git a/lib/redmine/preparation.rb b/lib/redmine/preparation.rb index 79f4f82ee..d2249b03e 100644 --- a/lib/redmine/preparation.rb +++ b/lib/redmine/preparation.rb @@ -169,7 +169,7 @@ module Redmine :caption => :label_project_plural menu.push :administration, {:controller => 'admin', :action => 'index'}, :if => Proc.new {User.current.admin?}, :last => true - menu.push :help, Info.help_url, :last => true + menu.push :help, Info.help_url, :html => {:target => '_blank', :rel => 'noopener'}, :last => true end MenuManager.map :account_menu do |menu| diff --git a/test/integration/layout_test.rb b/test/integration/layout_test.rb index 1679bd964..d9fd376af 100644 --- a/test/integration/layout_test.rb +++ b/test/integration/layout_test.rb @@ -127,4 +127,11 @@ class LayoutTest < Redmine::IntegrationTest get '/projects/ecookbook' assert_select 'div#quick-search form[action="/projects/ecookbook/search"]' end + + def test_help_and_powered_by_redmine_link_should_open_separate_tab + get '/' + assert_select '#top-menu a.help[target="_blank"][rel="noopener"]' + # "Powered by Redmine" link + assert_select '#footer a[target="_blank"][rel="noopener"]' + end end