shorten long line of lib/redmine.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@20467 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2020-11-22 12:58:15 +00:00
parent 2ab86419ce
commit 6b5e1636fa

View File

@@ -318,16 +318,21 @@ Redmine::MenuManager.map :admin_menu do |menu|
end end
Redmine::MenuManager.map :project_menu do |menu| Redmine::MenuManager.map :project_menu do |menu|
menu.push :new_object, nil, :caption => ' + ', menu.push(
:if => Proc.new { |p| Setting.new_item_menu_tab == '2' }, :new_object, nil, :caption => ' + ',
:html => { :id => 'new-object', :onclick => 'toggleNewObjectDropdown(); return false;' } :if => Proc.new {|p| Setting.new_item_menu_tab == '2'},
menu.push :new_issue_sub, :html => {:id => 'new-object',
{ :controller => 'issues', :action => 'new', :copy_from => nil }, :onclick => 'toggleNewObjectDropdown(); return false;'}
)
menu.push(
:new_issue_sub,
{:controller => 'issues', :action => 'new', :copy_from => nil},
:param => :project_id, :caption => :label_issue_new, :param => :project_id, :caption => :label_issue_new,
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)},
:if => Proc.new { |p| Issue.allowed_target_trackers(p).any? }, :if => Proc.new {|p| Issue.allowed_target_trackers(p).any?},
:permission => :add_issues, :permission => :add_issues,
:parent => :new_object :parent => :new_object
)
menu.push :new_issue_category, menu.push :new_issue_category,
{:controller => 'issue_categories', :action => 'new'}, {:controller => 'issue_categories', :action => 'new'},
:param => :project_id, :caption => :label_issue_category_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 :overview, {:controller => 'projects', :action => 'show'}
menu.push :activity, {:controller => 'activities', :action => 'index'} menu.push :activity, {:controller => 'activities', :action => 'index'}
menu.push :roadmap, {:controller => 'versions', :action => 'index'}, menu.push(
:roadmap,
{:controller => 'versions', :action => 'index'},
:param => :project_id, :param => :project_id,
:if => Proc.new {|p| Setting.display_subprojects_issues? ? p.rolled_up_versions.any? : p.shared_versions.any?} :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'}, menu.push :issues, {:controller => 'issues', :action => 'index'},
:param => :project_id, :caption => :label_issue_plural :param => :project_id, :caption => :label_issue_plural
menu.push :new_issue, {:controller => 'issues', :action => 'new', :copy_from => nil}, menu.push(
:new_issue,
{:controller => 'issues', :action => 'new', :copy_from => nil},
:param => :project_id, :caption => :label_issue_new, :param => :project_id, :caption => :label_issue_new,
:html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)}, :html => {:accesskey => Redmine::AccessKeys.key_for(:new_issue)},
:if => Proc.new {|p| Setting.new_item_menu_tab == '1' && Issue.allowed_target_trackers(p).any?}, :if =>
Proc.new do |p|
Setting.new_item_menu_tab == '1' &&
Issue.allowed_target_trackers(p).any?
end,
:permission => :add_issues :permission => :add_issues
)
menu.push :time_entries, {:controller => 'timelog', :action => 'index'}, menu.push :time_entries, {:controller => 'timelog', :action => 'index'},
:param => :project_id, :caption => :label_spent_time :param => :project_id, :caption => :label_spent_time
menu.push :gantt, {:controller => 'gantts', :action => 'show'}, menu.push :gantt, {:controller => 'gantts', :action => 'show'},