diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-19 11:53:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-19 11:53:43 +0000 |
commit | 0faa4568a0ab18277259ad1c89309c3c53fa42de (patch) | |
tree | 0bcdcc9bfb1263980715b650cffd3a7236d5feeb /app | |
parent | 3e031b4243b38c3739936ae143acf21d305cd570 (diff) | |
download | redmine-0faa4568a0ab18277259ad1c89309c3c53fa42de.tar.gz redmine-0faa4568a0ab18277259ad1c89309c3c53fa42de.zip |
Highlight the current item of the main menu.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1076 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application.rb | 3 | ||||
-rw-r--r-- | app/controllers/issue_categories_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/messages_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 7 | ||||
-rw-r--r-- | app/controllers/queries_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/reports_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/repositories_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/timelog_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/versions_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/wikis_controller.rb | 1 | ||||
-rw-r--r-- | app/views/layouts/base.rhtml | 8 |
11 files changed, 20 insertions, 8 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 25cf205f4..66cec7d2a 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -19,6 +19,9 @@ class ApplicationController < ActionController::Base before_filter :user_setup, :check_if_login_required, :set_localization filter_parameter_logging :password + include Redmine::MenuManager::MenuController + helper Redmine::MenuManager::MenuHelper + REDMINE_SUPPORTED_SCM.each do |scm| require_dependency "repository/#{scm.underscore}" end diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb index 2c1c6657b..a73935b4f 100644 --- a/app/controllers/issue_categories_controller.rb +++ b/app/controllers/issue_categories_controller.rb @@ -17,6 +17,7 @@ class IssueCategoriesController < ApplicationController layout 'base' + menu_item :settings before_filter :find_project, :authorize verify :method => :post, :only => :destroy diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 8078abf71..49f4ba77c 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -17,6 +17,7 @@ class MessagesController < ApplicationController layout 'base' + menu_item :boards before_filter :find_board, :only => :new before_filter :find_message, :except => :new before_filter :authorize diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6add8585b..f38ca828e 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -17,6 +17,13 @@ class ProjectsController < ApplicationController layout 'base' + menu_item :overview + menu_item :activity, :only => :activity + menu_item :roadmap, :only => :roadmap + menu_item :files, :only => [:list_files, :add_file] + menu_item :settings, :only => :settings + menu_item :issues, :only => [:add_issue, :bulk_edit_issues, :changelog, :move_issues] + before_filter :find_project, :except => [ :index, :list, :add ] before_filter :authorize, :except => [ :index, :list, :add, :archive, :unarchive, :destroy ] before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ] diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb index 69bad345a..0a762eee0 100644 --- a/app/controllers/queries_controller.rb +++ b/app/controllers/queries_controller.rb @@ -17,6 +17,7 @@ class QueriesController < ApplicationController layout 'base' + menu_item :issues before_filter :find_project, :authorize def index diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index e33fe8412..338059a50 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -17,6 +17,7 @@ class ReportsController < ApplicationController layout 'base' + menu_item :issues before_filter :find_project, :authorize def issue_report diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index f8b1eae81..6c2b088cc 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -24,6 +24,7 @@ end class RepositoriesController < ApplicationController layout 'base' + menu_item :repository before_filter :find_repository, :except => :edit before_filter :find_project, :only => :edit before_filter :authorize diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index f90c4527e..39e6d2fd3 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -16,7 +16,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class TimelogController < ApplicationController - layout 'base' + layout 'base' + menu_item :issues before_filter :find_project, :authorize helper :sort diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index df1be2869..55b3a7fce 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -17,6 +17,7 @@ class VersionsController < ApplicationController layout 'base' + menu_item :roadmap before_filter :find_project, :authorize cache_sweeper :version_sweeper, :only => [ :edit, :destroy ] diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index a222570ef..6054abd9a 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -17,6 +17,7 @@ class WikisController < ApplicationController layout 'base' + menu_item :settings before_filter :find_project, :authorize # Create or update a project's wiki diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index bdaddcb3b..91c3b2634 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -49,13 +49,7 @@ <h1><%= h(@project ? @project.name : Setting.app_title) %></h1> <div id="main-menu"> - <ul> - <% Redmine::MenuManager.allowed_items(:project_menu, User.current, @project).each do |item| %> - <% unless item.condition && !item.condition.call(@project) %> - <li><%= link_to l(item.name), {item.param => @project}.merge(item.url) %></li> - <% end %> - <% end if @project && !@project.new_record? %> - </ul> + <%= render_main_menu(@project) %> </div> </div> |