debian-mirror-gitlab/app/helpers/sourcegraph_helper.rb

24 lines
859 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +05:30
# frozen_string_literal: true
module SourcegraphHelper
def sourcegraph_url_message
message =
if Gitlab::CurrentSettings.sourcegraph_url_is_com?
2021-01-29 00:20:46 +05:30
s_('SourcegraphPreferences|Uses %{linkStart}Sourcegraph.com%{linkEnd}.').html_safe
2019-12-26 22:10:19 +05:30
else
2021-01-29 00:20:46 +05:30
s_('SourcegraphPreferences|Uses a custom %{linkStart}Sourcegraph instance%{linkEnd}.').html_safe
2019-12-26 22:10:19 +05:30
end
2021-01-29 00:20:46 +05:30
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-12-26 22:10:19 +05:30
2021-01-29 00:20:46 +05:30
"#{message} #{experimental_message}"
2019-12-26 22:10:19 +05:30
end
end