2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-05-01 23:48:42 +08:00
|
|
|
module ConfigurableUrls
|
2013-06-28 00:10:43 +08:00
|
|
|
def faq_path
|
2020-10-09 19:51:24 +08:00
|
|
|
SiteSetting.faq_url.blank? ? "#{Discourse.base_path}/faq" : SiteSetting.faq_url
|
2013-06-28 00:10:43 +08:00
|
|
|
end
|
|
|
|
|
2013-05-01 23:48:42 +08:00
|
|
|
def tos_path
|
2023-05-30 22:38:14 +08:00
|
|
|
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
|
2013-05-01 23:48:42 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def privacy_path
|
2023-05-30 22:38:14 +08:00
|
|
|
if SiteSetting.privacy_policy_url.present?
|
2020-10-09 19:51:24 +08:00
|
|
|
SiteSetting.privacy_policy_url
|
2023-05-30 22:38:14 +08:00
|
|
|
elsif SiteSetting.privacy_topic_id > 0 && Topic.exists?(id: SiteSetting.privacy_topic_id)
|
|
|
|
"#{Discourse.base_path}/privacy"
|
2023-01-09 20:10:19 +08:00
|
|
|
end
|
2013-05-01 23:48:42 +08:00
|
|
|
end
|
2015-04-25 01:10:43 +08:00
|
|
|
end
|