diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/helpers/sourcegraph_helper.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/helpers/sourcegraph_helper.rb')
-rw-r--r-- | app/helpers/sourcegraph_helper.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/app/helpers/sourcegraph_helper.rb b/app/helpers/sourcegraph_helper.rb index cc5a5c77e9a..25d7b209b45 100644 --- a/app/helpers/sourcegraph_helper.rb +++ b/app/helpers/sourcegraph_helper.rb @@ -2,26 +2,22 @@ module SourcegraphHelper def sourcegraph_url_message - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: Gitlab::CurrentSettings.sourcegraph_url } - link_end = "#{sprite_icon('external-link', size: 12, css_class: 'ml-1 vertical-align-center')}</a>".html_safe - message = if Gitlab::CurrentSettings.sourcegraph_url_is_com? - s_('SourcegraphPreferences|Uses %{link_start}Sourcegraph.com%{link_end}.').html_safe + s_('SourcegraphPreferences|Uses %{linkStart}Sourcegraph.com%{linkEnd}.').html_safe else - s_('SourcegraphPreferences|Uses a custom %{link_start}Sourcegraph instance%{link_end}.').html_safe + s_('SourcegraphPreferences|Uses a custom %{linkStart}Sourcegraph instance%{linkEnd}.').html_safe end - message % { link_start: link_start, link_end: link_end } - end + experimental_message = + if Gitlab::Sourcegraph.feature_conditional? + s_("SourcegraphPreferences|This feature is experimental and currently limited to certain projects.") + elsif Gitlab::CurrentSettings.sourcegraph_public_only + s_("SourcegraphPreferences|This feature is experimental and limited to public projects.") + else + s_("SourcegraphPreferences|This feature is experimental.") + end - def sourcegraph_experimental_message - if Gitlab::Sourcegraph.feature_conditional? - s_("SourcegraphPreferences|This feature is experimental and currently limited to certain projects.") - elsif Gitlab::CurrentSettings.sourcegraph_public_only - s_("SourcegraphPreferences|This feature is experimental and limited to public projects.") - else - s_("SourcegraphPreferences|This feature is experimental.") - end + "#{message} #{experimental_message}" end end |