summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-04-15 17:00:53 +0100
committerPhil Hughes <me@iamphill.com>2016-04-26 09:03:04 +0100
commit262a3dd482680466b5bdc3fa1b94e06491e7a906 (patch)
treedbb1459653ba3827b915f4adbd6ab687544bbeed /app
parent3b5879e50c11baf3039512107c114c595baaf14e (diff)
downloadgitlab-ce-262a3dd482680466b5bdc3fa1b94e06491e7a906.tar.gz
Humanize scope text
Diffstat (limited to 'app')
-rw-r--r--app/helpers/search_helper.rb4
-rw-r--r--app/views/search/_results.html.haml2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 1b8053d1b1c..43169d1c9db 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -19,13 +19,13 @@ module SearchHelper
end
end
- def search_entries_info(collection)
+ def search_entries_info(collection, scope, term)
if collection.count > 0
from = collection.offset_value + 1
to = collection.offset_value + collection.length
count = collection.count
- "Showing #{from} - #{to} of #{count} results for \"#{@search_term}\""
+ "Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\""
end
end
diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml
index a7615f580f0..252c1508a50 100644
--- a/app/views/search/_results.html.haml
+++ b/app/views/search/_results.html.haml
@@ -2,7 +2,7 @@
= render partial: "search/results/empty"
- else
.gray-content-block
- = search_entries_info @objects
+ = search_entries_info @objects, @scope, @search_term
- unless @show_snippets
- if @project
in project #{link_to @project.name_with_namespace, [@project.namespace.becomes(Namespace), @project]}