Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2013-11-06 19:13:21 +0400
committerJason Hollingsworth <jhworth.developer@gmail.com>2013-11-27 08:22:07 +0400
commitd9bb4230cc3aa161876df821c34d8e9c53d2e7a6 (patch)
treed9923bbf4ebe3f6cf96f71cdcfe4c07cc94b6752 /app/helpers/search_helper.rb
parent51b5509bacdfba1d3ca84a4b56c6bd21942f1d2e (diff)
Adding authenticated public mode (internal).
Added visibility_level icons to project view (rather than just text). Added public projects to search results. Added ability to restrict visibility levels standard users can set.
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r--app/helpers/search_helper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 33c5e4fb9db..8ff0bc67b71 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -1,10 +1,10 @@
module SearchHelper
def search_autocomplete_source
return unless current_user
-
[
groups_autocomplete,
projects_autocomplete,
+ public_projects_autocomplete,
default_autocomplete,
project_autocomplete,
help_autocomplete
@@ -75,4 +75,11 @@ module SearchHelper
{ label: "project: #{simple_sanitize(p.name_with_namespace)}", url: project_path(p) }
end
end
+
+ # Autocomplete results for the current user's projects
+ def public_projects_autocomplete
+ Project.public_or_internal_only(current_user).map do |p|
+ { label: "project: #{simple_sanitize(p.name_with_namespace)}", url: project_path(p) }
+ end
+ end
end