From bbf982984dc4eb0ee63be409e0aad5d3b21a1f1d Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 26 Apr 2013 18:30:21 -0400 Subject: [PATCH] Add TOS and Privacy Policy site settings that can link to external sites. --- app/helpers/application_helper.rb | 4 ++-- app/models/site_setting.rb | 2 ++ config/locales/server.en.yml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 006edccf4c4..1f67a704b26 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -63,11 +63,11 @@ module ApplicationHelper end def tos_path - return "#{Discourse::base_uri}/tos" + SiteSetting.tos_url.blank? ? "#{Discourse::base_uri}/tos" : SiteSetting.tos_url end def privacy_path - return "#{Discourse::base_uri}/privacy" + SiteSetting.privacy_policy_url.blank? ? "#{Discourse::base_uri}/privacy" : SiteSetting.privacy_policy_url end def login_path diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index 1e94e265c59..3daaefa6540 100755 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -16,6 +16,8 @@ class SiteSetting < ActiveRecord::Base setting(:company_full_name, 'My Unconfigured Forum Ltd.') setting(:company_short_name, 'Unconfigured Forum') setting(:company_domain, 'www.example.com') + setting(:tos_url, '') + setting(:privacy_policy_url, '') setting(:api_key, '') client_setting(:traditional_markdown_linebreaks, false) client_setting(:top_menu, 'latest|new|unread|favorited|categories') diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index c742fa6ce34..fac3c0cb2df 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -541,6 +541,9 @@ en: topic_views_heat_medium: "The number of views after which a topic's heat level is medium." topic_views_heat_high: "The number of views after which a topic's heat level is high." + tos_url: "If you have a Terms of Service document hosted elsewhere that you want to use, provide the full URL here." + privacy_policy_url: "If you have a Privacy Policy document hosted elsewhere that you want to use, provide the full URL here." + notification_types: mentioned: "%{display_username} mentioned you in %{link}" liked: "%{display_username} liked your post in %{link}"