Project

General

Profile

« Previous | Next » 

Revision 1137

The following menus can now be extended by plugins: top_menu, account_menu, application_menu (empty by default).
Sligth layout change: links in the top menu are now li elements.

View differences:

redmine.rb
88 88
  end
89 89
end
90 90

  
91
# Project menu configuration
91
Redmine::MenuManager.map :top_menu do |menu|
92
  menu.push :home, :home_url, :html => { :class => 'home' }
93
  menu.push :my_page, { :controller => 'my', :action => 'page' }, :html => { :class => 'mypage' }, :if => Proc.new { User.current.logged? }
94
  menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural, :html => { :class => 'projects' }
95
  menu.push :administration, { :controller => 'admin', :action => 'index' }, :html => { :class => 'admin' }, :if => Proc.new { User.current.admin? }
96
  menu.push :help, Redmine::Info.help_url, :html => { :class => 'help' }
97
end
98

  
99
Redmine::MenuManager.map :account_menu do |menu|
100
  menu.push :login, :signin_url, :html => { :class => 'login' }, :if => Proc.new { !User.current.logged? }
101
  menu.push :register, { :controller => 'account', :action => 'register' }, :html => { :class => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
102
  menu.push :my_account, { :controller => 'my', :action => 'account' }, :html => { :class => 'myaccount' }, :if => Proc.new { User.current.logged? }
103
  menu.push :logout, :signout_url, :html => { :class => 'logout' }, :if => Proc.new { User.current.logged? }
104
end
105

  
106
Redmine::MenuManager.map :application_menu do |menu|
107
  # Empty
108
end
109

  
92 110
Redmine::MenuManager.map :project_menu do |menu|
93
  menu.push :overview, { :controller => 'projects', :action => 'show' }, :caption => :label_overview
94
  menu.push :activity, { :controller => 'projects', :action => 'activity' }, :caption => :label_activity
111
  menu.push :overview, { :controller => 'projects', :action => 'show' }
112
  menu.push :activity, { :controller => 'projects', :action => 'activity' }
95 113
  menu.push :roadmap, { :controller => 'projects', :action => 'roadmap' }, 
96
              :if => Proc.new { |p| p.versions.any? }, :caption => :label_roadmap
114
              :if => Proc.new { |p| p.versions.any? }
97 115
  menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural
98 116
  menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new,
99 117
              :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
100 118
  menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
101 119
  menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
102 120
  menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, 
103
              :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }, :caption => :label_wiki
121
              :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
104 122
  menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id,
105 123
              :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural
106 124
  menu.push :files, { :controller => 'projects', :action => 'list_files' }, :caption => :label_attachment_plural
107 125
  menu.push :repository, { :controller => 'repositories', :action => 'show' },
108
              :if => Proc.new { |p| p.repository && !p.repository.new_record? }, :caption => :label_repository
109
  menu.push :settings, { :controller => 'projects', :action => 'settings' }, :caption => :label_settings
126
              :if => Proc.new { |p| p.repository && !p.repository.new_record? }
127
  menu.push :settings, { :controller => 'projects', :action => 'settings' }
110 128
end

Also available in: Unified diff