diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 413328f022..6da3fdda8c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3,10 +3,12 @@ require 'canonical_url'
require_dependency 'guardian'
require_dependency 'unread'
require_dependency 'age_words'
+require_dependency 'configurable_urls'
module ApplicationHelper
include CurrentUser
include CanonicalURL::Helpers
+ include ConfigurableUrls
def with_format(format, &block)
old_formats = formats
@@ -62,14 +64,6 @@ module ApplicationHelper
return "#{Discourse::base_uri}/faq"
end
- def tos_path
- SiteSetting.tos_url.blank? ? "#{Discourse::base_uri}/tos" : SiteSetting.tos_url
- end
-
- def privacy_path
- SiteSetting.privacy_policy_url.blank? ? "#{Discourse::base_uri}/privacy" : SiteSetting.privacy_policy_url
- end
-
def login_path
return "#{Discourse::base_uri}/login"
end
diff --git a/app/serializers/post_action_type_serializer.rb b/app/serializers/post_action_type_serializer.rb
index f0dfb08083..763bc3886b 100644
--- a/app/serializers/post_action_type_serializer.rb
+++ b/app/serializers/post_action_type_serializer.rb
@@ -1,7 +1,11 @@
+require_dependency 'configurable_urls'
+
class PostActionTypeSerializer < ApplicationSerializer
attributes :name_key, :name, :description, :long_form, :is_flag, :icon, :id, :is_custom_flag
+ include ConfigurableUrls
+
def is_custom_flag
object.id == PostActionType.types[:notify_user] ||
object.id == PostActionType.types[:notify_moderators]
@@ -16,13 +20,13 @@ class PostActionTypeSerializer < ApplicationSerializer
end
def description
- i18n('description')
+ i18n('description', {tos_url: tos_path})
end
protected
- def i18n(field)
- I18n.t("post_action_types.#{object.name_key}.#{field}")
+ def i18n(field, vars={})
+ I18n.t("post_action_types.#{object.name_key}.#{field}", vars)
end
end
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 0d6781bb62..4401f96df2 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -236,7 +236,7 @@ en:
email_body: "%{link}\n\n%{message}"
notify_moderators:
title: 'Notify moderators'
- description: 'This post requires general moderator attention based on the FAQ, TOS, or for another reason not listed above.'
+ description: 'This post requires general moderator attention based on the FAQ, TOS, or for another reason not listed above.'
long_form: 'notified moderators'
email_title: 'A post in "%{title}" requires moderator attention'
email_body: "%{link}\n\n%{message}"
diff --git a/lib/configurable_urls.rb b/lib/configurable_urls.rb
new file mode 100644
index 0000000000..fe3f7e2227
--- /dev/null
+++ b/lib/configurable_urls.rb
@@ -0,0 +1,11 @@
+module ConfigurableUrls
+
+ def tos_path
+ SiteSetting.tos_url.blank? ? "#{Discourse::base_uri}/tos" : SiteSetting.tos_url
+ end
+
+ def privacy_path
+ SiteSetting.privacy_policy_url.blank? ? "#{Discourse::base_uri}/privacy" : SiteSetting.privacy_policy_url
+ end
+
+end
\ No newline at end of file