summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-16 12:21:31 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-16 12:21:31 +0000
commitd31c89a574f5f1de40764ff1022ec3fd2aab89b1 (patch)
treea012b7effeca91ffa8b77807287f8dc93ae781dc
parent90405c2021169b8b067b7346a9a38bb8f50e8d90 (diff)
downloadredmine-d31c89a574f5f1de40764ff1022ec3fd2aab89b1.tar.gz
redmine-d31c89a574f5f1de40764ff1022ec3fd2aab89b1.zip
shorten long line of lib/redmine.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20389 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine.rb80
1 files changed, 50 insertions, 30 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb
index de2993e13..d3605efc8 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -226,36 +226,56 @@ Redmine::MenuManager.map :application_menu do |menu|
:permission => nil,
:caption => :label_project_plural
menu.push :activity, {:controller => 'activities', :action => 'index'}
- menu.push :issues, {:controller => 'issues', :action => 'index'},
- :if => Proc.new {
- User.current.allowed_to?(:view_issues, nil, :global => true) &&
- EnabledModule.exists?(:project => Project.visible, :name => :issue_tracking)
- },
- :caption => :label_issue_plural
- menu.push :time_entries, {:controller => 'timelog', :action => 'index'},
- :if => Proc.new {
- User.current.allowed_to?(:view_time_entries, nil, :global => true) &&
- EnabledModule.exists?(:project => Project.visible, :name => :time_tracking)
- },
- :caption => :label_spent_time
- menu.push :gantt, { :controller => 'gantts', :action => 'show' },
- :caption => :label_gantt,
- :if => Proc.new {
- User.current.allowed_to?(:view_gantt, nil, :global => true) &&
- EnabledModule.exists?(:project => Project.visible, :name => :gantt)
- }
- menu.push :calendar, { :controller => 'calendars', :action => 'show' },
- :caption => :label_calendar,
- :if => Proc.new {
- User.current.allowed_to?(:view_calendar, nil, :global => true) &&
- EnabledModule.exists?(:project => Project.visible, :name => :calendar)
- }
- menu.push :news, {:controller => 'news', :action => 'index'},
- :if => Proc.new {
- User.current.allowed_to?(:view_news, nil, :global => true) &&
- EnabledModule.exists?(:project => Project.visible, :name => :news)
- },
- :caption => :label_news_plural
+ menu.push(
+ :issues,
+ {:controller => 'issues', :action => 'index'},
+ :if =>
+ Proc.new do
+ User.current.allowed_to?(:view_issues, nil, :global => true) &&
+ EnabledModule.exists?(:project => Project.visible, :name => :issue_tracking)
+ end,
+ :caption => :label_issue_plural
+ )
+ menu.push(
+ :time_entries,
+ {:controller => 'timelog', :action => 'index'},
+ :if =>
+ Proc.new do
+ User.current.allowed_to?(:view_time_entries, nil, :global => true) &&
+ EnabledModule.exists?(:project => Project.visible, :name => :time_tracking)
+ end,
+ :caption => :label_spent_time
+ )
+ menu.push(
+ :gantt,
+ {:controller => 'gantts', :action => 'show'},
+ :caption => :label_gantt,
+ :if =>
+ Proc.new do
+ User.current.allowed_to?(:view_gantt, nil, :global => true) &&
+ EnabledModule.exists?(:project => Project.visible, :name => :gantt)
+ end
+ )
+ menu.push(
+ :calendar,
+ {:controller => 'calendars', :action => 'show'},
+ :caption => :label_calendar,
+ :if =>
+ Proc.new do
+ User.current.allowed_to?(:view_calendar, nil, :global => true) &&
+ EnabledModule.exists?(:project => Project.visible, :name => :calendar)
+ end
+ )
+ menu.push(
+ :news,
+ {:controller => 'news', :action => 'index'},
+ :if =>
+ Proc.new do
+ User.current.allowed_to?(:view_news, nil, :global => true) &&
+ EnabledModule.exists?(:project => Project.visible, :name => :news)
+ end,
+ :caption => :label_news_plural
+ )
end
Redmine::MenuManager.map :admin_menu do |menu|