diff --git a/app/assets/javascripts/discourse/components/posts-count-column.js.es6 b/app/assets/javascripts/discourse/components/posts-count-column.js.es6 index b4b71f2971..94dab2bc86 100644 --- a/app/assets/javascripts/discourse/components/posts-count-column.js.es6 +++ b/app/assets/javascripts/discourse/components/posts-count-column.js.es6 @@ -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'), diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 36bcb666a7..d76574e955 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -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." diff --git a/config/site_settings.yml b/config/site_settings.yml index 10820894d3..ed4f22cb51 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -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 diff --git a/lib/site_setting_extension.rb b/lib/site_setting_extension.rb index 31a18c97c0..686e513699 100644 --- a/lib/site_setting_extension.rb +++ b/lib/site_setting_extension.rb @@ -317,6 +317,8 @@ module SiteSettingExtension types[:string] when Fixnum types[:fixnum] + when Float + types[:float] when TrueClass, FalseClass types[:bool] else