]> source.dussan.org Git - redmine.git/commitdiff
Open Help in a separate tab (#1069).
authorGo MAEDA <maeda@farend.jp>
Fri, 22 Jul 2022 01:33:38 +0000 (01:33 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 22 Jul 2022 01:33:38 +0000 (01:33 +0000)
Contributed by Vijay Kiran.

git-svn-id: https://svn.redmine.org/redmine/trunk@21737 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/layouts/base.html.erb
lib/redmine/preparation.rb
test/integration/layout_test.rb

index 8114ff9e0cadc8d4ba0789e441fba050d1cc2234..0a1f2ae3862310241c23c55c3ca648bfd6c56bfa 100644 (file)
     </div>
 </div>
 <div id="footer">
-    Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2022 Jean-Philippe Lang
+    Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url, :target => '_blank', :rel => 'noopener' %> &copy; 2006-2022 Jean-Philippe Lang
 </div>
 
 <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
index 79f4f82eec4b99bd4b6c98dc0d959d4324c5542b..d2249b03e78ac2c0c5b8d07cd7b5347addc8be7f 100644 (file)
@@ -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|
index 1679bd964c5fe59ecd50547607b534f5fabdd7cf..d9fd376af7dce42f176852cf9e14dc8303d3bd8d 100644 (file)
@@ -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