summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/search_controller.rb4
-rw-r--r--app/helpers/search_helper.rb3
2 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index d93c63808..d4ef01bf8 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -30,11 +30,13 @@ class SearchController < ApplicationController
@titles_only = !params[:titles_only].nil?
projects_to_search =
- case params[:projects]
+ case params[:scope]
when 'all'
nil
when 'my_projects'
User.current.memberships.collect(&:project)
+ when 'subprojects'
+ @project ? ([ @project ] + @project.active_children) : nil
else
@project
end
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 6b5a2cede..d6a2fb949 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -39,7 +39,8 @@ 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_and_its_subprojects, @project.name), 'subprojects'] unless @project.nil? || @project.active_children.empty?
options << [@project.name, ''] unless @project.nil?
- select_tag('projects', options_for_select(options, params[:projects].to_s)) if options.size > 1
+ select_tag('scope', options_for_select(options, params[:scope].to_s)) if options.size > 1
end
end