diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-22 12:58:15 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-11-22 12:58:15 +0000 |
commit | 6b5e1636fab340a1bb6dc97e790aaac1627a110c (patch) | |
tree | cde2929e1fa26b8b000d50d4b304e99a03cdc856 /lib | |
parent | 2ab86419cec451b7917c2b6b05ce25d9472b7558 (diff) | |
download | redmine-6b5e1636fab340a1bb6dc97e790aaac1627a110c.tar.gz redmine-6b5e1636fab340a1bb6dc97e790aaac1627a110c.zip |
shorten long line of lib/redmine.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20467 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine.rb | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb index 9eaa64ff3..409da528a 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -318,16 +318,21 @@ Redmine::MenuManager.map :admin_menu do |menu| end Redmine::MenuManager.map :project_menu do |menu| - menu.push :new_object, nil, :caption => ' + ', - :if => Proc.new { |p| Setting.new_item_menu_tab == '2' }, - :html => { :id => 'new-object', :onclick => 'toggleNewObjectDropdown(); return false;' } - menu.push :new_issue_sub, - { :controller => 'issues', :action => 'new', :copy_from => nil }, - :param => :project_id, :caption => :label_issue_new, - :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, - :if => Proc.new { |p| Issue.allowed_target_trackers(p).any? }, - :permission => :add_issues, - :parent => :new_object + menu.push( + :new_object, nil, :caption => ' + ', + :if => Proc.new {|p| Setting.new_item_menu_tab == '2'}, + :html => {:id => 'new-object', + :onclick => 'toggleNewObjectDropdown(); return false;'} + ) + menu.push( + :new_issue_sub, + {:controller => 'issues', :action => 'new', :copy_from => nil}, + :param => :project_id, :caption => :label_issue_new, + :html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, + :if => Proc.new {|p| Issue.allowed_target_trackers(p).any?}, + :permission => :add_issues, + :parent => :new_object + ) menu.push :new_issue_category, {:controller => 'issue_categories', :action => 'new'}, :param => :project_id, :caption => :label_issue_category_new, @@ -353,16 +358,33 @@ Redmine::MenuManager.map :project_menu do |menu| menu.push :overview, {:controller => 'projects', :action => 'show'} menu.push :activity, {:controller => 'activities', :action => 'index'} - menu.push :roadmap, {:controller => 'versions', :action => 'index'}, - :param => :project_id, - :if => Proc.new {|p| Setting.display_subprojects_issues? ? p.rolled_up_versions.any? : p.shared_versions.any?} + menu.push( + :roadmap, + {:controller => 'versions', :action => 'index'}, + :param => :project_id, + :if => + Proc.new do |p| + if Setting.display_subprojects_issues? + p.rolled_up_versions.any? + else + p.shared_versions.any? + end + end + ) menu.push :issues, {:controller => 'issues', :action => 'index'}, :param => :project_id, :caption => :label_issue_plural - menu.push :new_issue, {:controller => 'issues', :action => 'new', :copy_from => nil}, - :param => :project_id, :caption => :label_issue_new, - :html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, - :if => Proc.new {|p| Setting.new_item_menu_tab == '1' && Issue.allowed_target_trackers(p).any?}, - :permission => :add_issues + menu.push( + :new_issue, + {:controller => 'issues', :action => 'new', :copy_from => nil}, + :param => :project_id, :caption => :label_issue_new, + :html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, + :if => + Proc.new do |p| + Setting.new_item_menu_tab == '1' && + Issue.allowed_target_trackers(p).any? + end, + :permission => :add_issues + ) menu.push :time_entries, {:controller => 'timelog', :action => 'index'}, :param => :project_id, :caption => :label_spent_time menu.push :gantt, {:controller => 'gantts', :action => 'show'}, |