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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-19 12:06:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-19 12:06:27 +0300
commitb3e0658cb1fbc7c8e7dd381467c656f2e675ee46 (patch)
tree56f0231bca8a7f45bcd88da2b716e6b672e6f602 /app/helpers/search_helper.rb
parent82a534c245f830d7692d03c557075f211bec6e75 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r--app/helpers/search_helper.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 0f4e5adca6c..c65611b7efc 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -34,15 +34,15 @@ module SearchHelper
from: from,
to: to,
count: count,
- scope: search_entries_info_label(scope, count),
+ scope: search_entries_scope_label(scope, count),
term: term
}
end
- def search_entries_info_label(scope, count)
+ def search_entries_scope_label(scope, count)
case scope
- when 'blobs', 'snippet_blobs', 'wiki_blobs'
- ns_('SearchResults|result', 'SearchResults|results', count)
+ when 'blobs'
+ ns_('SearchResults|code result', 'SearchResults|code results', count)
when 'commits'
ns_('SearchResults|commit', 'SearchResults|commits', count)
when 'issues'
@@ -55,10 +55,14 @@ module SearchHelper
ns_('SearchResults|comment', 'SearchResults|comments', count)
when 'projects'
ns_('SearchResults|project', 'SearchResults|projects', count)
+ when 'snippet_blobs'
+ ns_('SearchResults|snippet result', 'SearchResults|snippet results', count)
when 'snippet_titles'
ns_('SearchResults|snippet', 'SearchResults|snippets', count)
when 'users'
ns_('SearchResults|user', 'SearchResults|users', count)
+ when 'wiki_blobs'
+ ns_('SearchResults|wiki result', 'SearchResults|wiki results', count)
else
raise "Unrecognized search scope '#{scope}'"
end
@@ -72,6 +76,13 @@ module SearchHelper
end
end
+ def search_entries_empty_message(scope, term)
+ (s_("SearchResults|We couldn't find any %{scope} matching %{term}") % {
+ scope: search_entries_scope_label(scope, 0),
+ term: "<code>#{term}</code>"
+ }).html_safe
+ end
+
def find_project_for_result_blob(projects, result)
@project
end