2019-11-15 13:06:24 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module SourcegraphHelper
|
|
|
|
def sourcegraph_url_message
|
|
|
|
message =
|
|
|
|
if Gitlab::CurrentSettings.sourcegraph_url_is_com?
|
2020-11-13 13:09:11 -05:00
|
|
|
s_('SourcegraphPreferences|Uses %{linkStart}Sourcegraph.com%{linkEnd}.').html_safe
|
2019-11-15 13:06:24 -05:00
|
|
|
else
|
2020-11-13 13:09:11 -05:00
|
|
|
s_('SourcegraphPreferences|Uses a custom %{linkStart}Sourcegraph instance%{linkEnd}.').html_safe
|
2019-11-15 13:06:24 -05:00
|
|
|
end
|
|
|
|
|
2020-11-13 13:09:11 -05:00
|
|
|
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
|
2019-11-15 13:06:24 -05:00
|
|
|
|
2020-11-13 13:09:11 -05:00
|
|
|
"#{message} #{experimental_message}"
|
2019-11-15 13:06:24 -05:00
|
|
|
end
|
|
|
|
end
|