Adds Site settings to configure post:like ratio thresholds

This commit is contained in:
Robin Ward 2014-08-15 12:02:29 -04:00
parent eb5a3da10d
commit 26ca197be9
4 changed files with 20 additions and 3 deletions

View File

@ -22,9 +22,9 @@ export default Ember.Component.extend({
ratioText: function() {
var ratio = this.get('ratio');
if (ratio > 2.0) { return 'high'; }
if (ratio > 1.0) { return 'med'; }
if (ratio > 0.5) { return 'low'; }
if (ratio > Discourse.SiteSettings.topic_post_like_heat_high) { return 'high'; }
if (ratio > Discourse.SiteSettings.topic_post_like_heat_medium) { return 'med'; }
if (ratio > Discourse.SiteSettings.topic_post_like_heat_low) { return 'low'; }
return '';
}.property('ratio'),

View File

@ -890,6 +890,10 @@ en:
topic_views_heat_medium: "After this many views, the topic is moderately highlighted."
topic_views_heat_high: "After this many views, the topic is strongly highlighted."
topic_post_like_heat_low: "A post with this likes:post ratio is slightly highlighted."
topic_post_like_heat_medium: "A post with this likes:post ratio is slightly highlighted."
topic_post_like_heat_high: "A post with this likes:post ratio is slightly highlighted."
faq_url: "If you have a FAQ hosted elsewhere that you want to use, provide the full URL here."
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."

View File

@ -670,6 +670,17 @@ uncategorized:
client: true
default: 5000
# Post/Like heat thresholds
topic_post_like_heat_low:
client: true
default: 0.5
topic_post_like_heat_medium:
client: true
default: 1.0
topic_post_like_heat_high:
client: true
default: 2.0
# Warnings
educate_until_posts: 2
sequential_replies_threshold: 2

View File

@ -317,6 +317,8 @@ module SiteSettingExtension
types[:string]
when Fixnum
types[:fixnum]
when Float
types[:float]
when TrueClass, FalseClass
types[:bool]
else