diff --git a/app/assets/javascripts/discourse/components/activity-column.js.es6 b/app/assets/javascripts/discourse/components/activity-column.js.es6 index 5a758902136..3f17f5b427e 100644 --- a/app/assets/javascripts/discourse/components/activity-column.js.es6 +++ b/app/assets/javascripts/discourse/components/activity-column.js.es6 @@ -26,9 +26,9 @@ export default Ember.Component.extend({ if (!bumpedAt) { return; } var delta = daysSinceEpoch(bumpedAt) - daysSinceEpoch(createdAt); - if (delta > 120) { return 'coldmap-high'; } - if (delta > 60) { return 'coldmap-med'; } - if (delta > 14) { return 'coldmap-low'; } + if (delta > Discourse.SiteSettings.cold_age_days_high) { return 'coldmap-high'; } + if (delta > Discourse.SiteSettings.cold_age_days_medium) { return 'coldmap-med'; } + if (delta > Discourse.SiteSettings.cold_age_days_low) { return 'coldmap-low'; } }.property('bumpedAt', 'createdAt'), title: function() { diff --git a/app/assets/javascripts/discourse/helpers/cold-age-class.js.es6 b/app/assets/javascripts/discourse/helpers/cold-age-class.js.es6 index a3bfaf6ea0e..d7d644a79a0 100644 --- a/app/assets/javascripts/discourse/helpers/cold-age-class.js.es6 +++ b/app/assets/javascripts/discourse/helpers/cold-age-class.js.es6 @@ -14,9 +14,10 @@ function coldAgeClass(property, options) { // Show heat on age var nowDays = daysSinceEpoch(new Date()), epochDays = daysSinceEpoch(new Date(dt)); - if (nowDays - epochDays > 60) return 'age coldmap-high'; - if (nowDays - epochDays > 30) return 'age coldmap-med'; - if (nowDays - epochDays > 14) return 'age coldmap-low'; + + if (nowDays - epochDays > Discourse.SiteSettings.cold_age_days_high) return 'age coldmap-high'; + if (nowDays - epochDays > Discourse.SiteSettings.cold_age_days_medium) return 'age coldmap-med'; + if (nowDays - epochDays > Discourse.SiteSettings.cold_age_days_low) return 'age coldmap-low'; return 'age'; } diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index d76574e955c..43bd56d3bb7 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -890,9 +890,13 @@ 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." + cold_age_days_low: "A topic this many days old is slightly highligted." + cold_age_days_medium: "A topic this many days old is slightly highligted." + cold_age_days_high: "A topic this many days old is slightly highligted." + + topic_post_like_heat_low: "A topic with this likes:post ratio is slightly highlighted." + topic_post_like_heat_medium: "A topic with this likes:post ratio is slightly highlighted." + topic_post_like_heat_high: "A topic 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." diff --git a/config/site_settings.yml b/config/site_settings.yml index ed4f22cb51a..4e11f49bdd8 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -681,6 +681,17 @@ uncategorized: client: true default: 2.0 + # Cold map thresholds + cold_age_days_low: + client: true + default: 14 + cold_age_days_medium: + client: true + default: 60 + cold_age_days_high: + client: true + default: 120 + # Warnings educate_until_posts: 2 sequential_replies_threshold: 2