diff options
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 |