A platform for community discussion. Free, open, simple.
FEATURE: Add hot as a homepage option (#25325)
Blake Erickson561851b10456
diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js b/app/assets/javascripts/discourse/app/controllers/preferences/interface.jsindex 979a91678bb..19003db66bd 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/interface.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/interface.js@@ -44,6 +44,10 @@ export default Controller.extend({this._super(...arguments);this.set("selectedDarkColorSchemeId", this.session.userDarkSchemeId);++ if (this.siteSettings.experimental_hot_topics) {+ USER_HOMES[8] = "hot";+ }},@discourseComputed("makeThemeDefault")diff --git a/app/models/user_option.rb b/app/models/user_option.rbindex 1fb652a271f..b62b2d42431 100644--- a/app/models/user_option.rb+++ b/app/models/user_option.rb@@ -185,6 +185,12 @@ class UserOption < ActiveRecord::Base"bookmarks"when 7"unseen"+ when 8+ if SiteSetting.experimental_hot_topics+ "hot"+ else+ SiteSetting.homepage+ endelseSiteSetting.homepageenddiff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex dbdae947324..fb28c97ae7a 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -2956,6 +2956,7 @@ en:bookmarks: "You have no bookmarked topics yet."category: "There are no %{category} topics."top: "There are no top topics."+ hot: "There are no hot topics."filter: "There are no topics."educate:new: '<p>Your new topics will appear here. By default, topics are considered new and will show a <span class="badge new-topic badge-notification" style="vertical-align:middle;line-height:inherit;"></span> indicator if they were created in the last 2 days.</p><p>Visit your <a href="%{userPrefsUrl}">preferences</a> to change this.</p>'diff --git a/config/site_settings.yml b/config/site_settings.ymlindex e781553261a..14bbfc787ab 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -189,6 +189,7 @@ basic:- read- posted- bookmarks+ - hotpost_menu:client: truetype: list@@ -3121,6 +3122,7 @@ dashboard:experimental_hot_topics:hidden: truedefault: false+ client: truehot_topics_gravity:hidden: truedefault: 1.2