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
path: root/app
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
parent82a534c245f830d7692d03c557075f211bec6e75 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/helpers/search_helper.rb19
-rw-r--r--app/views/ci/runner/_how_to_setup_runner_automatically.html.haml22
-rw-r--r--app/views/groups/runners/_group_runners.html.haml4
-rw-r--r--app/views/projects/runners/_specific_runners.html.haml25
-rw-r--r--app/views/search/results/_empty.html.haml3
5 files changed, 45 insertions, 28 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
diff --git a/app/views/ci/runner/_how_to_setup_runner_automatically.html.haml b/app/views/ci/runner/_how_to_setup_runner_automatically.html.haml
new file mode 100644
index 00000000000..58d2ef5d5e6
--- /dev/null
+++ b/app/views/ci/runner/_how_to_setup_runner_automatically.html.haml
@@ -0,0 +1,22 @@
+.append-bottom-10
+ %h4= _('Set up a %{type} Runner automatically') % { type: type }
+
+%p
+ - link_to_help_page = link_to(_('Learn more about Kubernetes'),
+ help_page_path('user/project/clusters/index'),
+ target: '_blank',
+ rel: 'noopener noreferrer')
+
+ = _('You can easily install a Runner on a Kubernetes cluster. %{link_to_help_page}').html_safe % { link_to_help_page: link_to_help_page }
+
+%ol
+ %li
+ = _('Click the button below to begin the install process by navigating to the Kubernetes page')
+ %li
+ = _('Select an existing Kubernetes cluster or create a new one')
+ %li
+ = _('From the Kubernetes cluster details view, install Runner from the applications list')
+
+= link_to _('Install Runner on Kubernetes'),
+ clusters_path,
+ class: 'btn btn-info'
diff --git a/app/views/groups/runners/_group_runners.html.haml b/app/views/groups/runners/_group_runners.html.haml
index fd40ec5a984..f752bc0a702 100644
--- a/app/views/groups/runners/_group_runners.html.haml
+++ b/app/views/groups/runners/_group_runners.html.haml
@@ -10,6 +10,10 @@
-# Proper policies should be implemented per
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/45894
- if can?(current_user, :admin_pipeline, @group)
+ = render partial: 'ci/runner/how_to_setup_runner_automatically',
+ locals: { type: 'group',
+ clusters_path: group_clusters_path(@group) }
+ %hr
= render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: @group.runners_token,
type: 'group',
diff --git a/app/views/projects/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml
index dc56a515d4c..4cc67a8f5d8 100644
--- a/app/views/projects/runners/_specific_runners.html.haml
+++ b/app/views/projects/runners/_specific_runners.html.haml
@@ -2,28 +2,9 @@
= _('Specific Runners')
.bs-callout.help-callout
- .append-bottom-10
- %h4= _('Set up a specific Runner automatically')
-
- %p
- - link_to_help_page = link_to(_('Learn more about Kubernetes'),
- help_page_path('user/project/clusters/index'),
- target: '_blank',
- rel: 'noopener noreferrer')
-
- = _('You can easily install a Runner on a Kubernetes cluster. %{link_to_help_page}').html_safe % { link_to_help_page: link_to_help_page }
-
- %ol
- %li
- = _('Click the button below to begin the install process by navigating to the Kubernetes page')
- %li
- = _('Select an existing Kubernetes cluster or create a new one')
- %li
- = _('From the Kubernetes cluster details view, install Runner from the applications list')
-
- = link_to _('Install Runner on Kubernetes'),
- project_clusters_path(@project),
- class: 'btn btn-info'
+ = render partial: 'ci/runner/how_to_setup_runner_automatically',
+ locals: { type: 'specific',
+ clusters_path: project_clusters_path(@project) }
%hr
= render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: @project.runners_token,
diff --git a/app/views/search/results/_empty.html.haml b/app/views/search/results/_empty.html.haml
index 9d15995bb51..6c7c6de1178 100644
--- a/app/views/search/results/_empty.html.haml
+++ b/app/views/search/results/_empty.html.haml
@@ -2,5 +2,4 @@
.search_glyph
%h4
= icon('search')
- = _("We couldn't find any results matching")
- %code= @search_term
+ = search_entries_empty_message(@scope, @search_term)