mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:03:40 +08:00
c3d51e9c0a
Privacy Policy and Terms of Service topics are no longer created by default for communities that have not set a company name. For this reason, some URLs were pointing to 404 page.
24 lines
628 B
Ruby
24 lines
628 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ConfigurableUrls
|
|
def faq_path
|
|
SiteSetting.faq_url.blank? ? "#{Discourse.base_path}/faq" : SiteSetting.faq_url
|
|
end
|
|
|
|
def tos_path
|
|
if SiteSetting.tos_url.present?
|
|
SiteSetting.tos_url
|
|
elsif SiteSetting.tos_topic_id > 0 && Topic.exists?(id: SiteSetting.tos_topic_id)
|
|
"#{Discourse.base_path}/tos"
|
|
end
|
|
end
|
|
|
|
def privacy_path
|
|
if SiteSetting.privacy_policy_url.present?
|
|
SiteSetting.privacy_policy_url
|
|
elsif SiteSetting.privacy_topic_id > 0 && Topic.exists?(id: SiteSetting.privacy_topic_id)
|
|
"#{Discourse.base_path}/privacy"
|
|
end
|
|
end
|
|
end
|