summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-18 14:45:47 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-18 14:45:47 +0000
commit109962363437a7f5e9f724059a657f96dbe5de64 (patch)
treea5366541ed02c01b37ce1a7f2c103c801451ccd9 /app
parentfae39a954207bd055f4fa492b4ed08de9efbaf62 (diff)
downloadredmine-109962363437a7f5e9f724059a657f96dbe5de64.tar.gz
redmine-109962363437a7f5e9f724059a657f96dbe5de64.zip
Support "my bookmarks" in the search (#38459).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22204 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/search_controller.rb2
-rw-r--r--app/helpers/search_helper.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index b9ff59e90..a13b9932e 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -49,6 +49,8 @@ class SearchController < ApplicationController
nil
when 'my_projects'
User.current.projects
+ when 'bookmarks'
+ Project.where(id: User.current.bookmarked_project_ids)
when 'subprojects'
@project ? (@project.self_and_descendants.to_a) : nil
else
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 61331d728..d55cc14aa 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -47,6 +47,7 @@ module SearchHelper
def project_select_tag
options = [[l(:label_project_all), 'all']]
options << [l(:label_my_projects), 'my_projects'] unless User.current.memberships.empty?
+ options << [l(:label_my_bookmarks), 'bookmarks'] unless User.current.bookmarked_project_ids.empty?
options << [l(:label_and_its_subprojects, @project.name), 'subprojects'] unless @project.nil? || @project.descendants.active.empty?
options << [@project.name, ''] unless @project.nil?
label_tag("scope", l(:description_project_scope), :class => "hidden-for-sighted") +