diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-20 22:26:30 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-20 22:26:30 +0000 |
commit | 29403e710a8d0d83c81387f236082f209f3ba7ed (patch) | |
tree | 5e396ddcc22d5f7f93b75970340e0197a145f825 /app/controllers | |
parent | da78e654f13b9b13e1584bac91dae9631c12f63e (diff) | |
download | redmine-29403e710a8d0d83c81387f236082f209f3ba7ed.tar.gz redmine-29403e710a8d0d83c81387f236082f209f3ba7ed.zip |
Adds favorites and recently used projects lists to project jump box (#31355).
Patch by Jens Krämer.
git-svn-id: http://svn.redmine.org/redmine/trunk@18181 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 8 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 082bab939..0aaf54b66 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -57,6 +57,7 @@ class ApplicationController < ActionController::Base end before_action :session_expiration, :user_setup, :check_if_login_required, :set_localization, :check_password_change + after_action :record_project_usage rescue_from ::Unauthorized, :with => :deny_access rescue_from ::ActionView::MissingTemplate, :with => :missing_template @@ -403,6 +404,13 @@ class ApplicationController < ActionController::Base end end + def record_project_usage + if @project && @project.id && User.current.logged? && User.current.allowed_to?(:view_project, @project) + Redmine::ProjectJumpBox.new(User.current).project_used(@project) + end + true + end + def back_url url = params[:back_url] if url.nil? && referer = request.env['HTTP_REFERER'] diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 1f0aba53f..85949216a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -221,6 +221,19 @@ class ProjectsController < ApplicationController redirect_to_referer_or admin_projects_path(:status => params[:status]) end + def bookmark + jump_box = Redmine::ProjectJumpBox.new User.current + if request.delete? + jump_box.delete_project_bookmark @project + elsif request.post? + jump_box.bookmark_project @project + end + respond_to do |format| + format.js + format.html { redirect_to project_path(@project) } + end + end + def close @project.close redirect_to project_path(@project) |