diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 616356a07..4915cddad 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -346,6 +346,14 @@ module ApplicationHelper end end + # Returns the default scope for the quick search form + # Could be 'all', 'my_projects', 'subprojects' or nil (current project) + def default_search_project_scope + if @project && !@project.leaf? + 'subprojects' + end + end + # Returns an array of projects that are displayed in the quick-jump box def projects_for_jump_box(user=User.current) if user.logged? diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 126d86b41..4cdefbd47 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -75,6 +75,7 @@ <% if User.current.logged? || !Setting.login_required? %>