From 1d7df97c30739385a7a481e6ffe871c5fe529a8f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Sep 2016 15:57:23 +1000 Subject: [PATCH] FIX: display old category style on mobile --- .../discourse/models/category-list.js.es6 | 4 +++- .../discourse/routes/discovery-categories.js.es6 | 2 +- .../templates/mobile/discovery/categories.hbs | 12 ++++++++++-- config/locales/client.en.yml | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/models/category-list.js.es6 b/app/assets/javascripts/discourse/models/category-list.js.es6 index c2737cda4e1..9e6375adb6c 100644 --- a/app/assets/javascripts/discourse/models/category-list.js.es6 +++ b/app/assets/javascripts/discourse/models/category-list.js.es6 @@ -13,7 +13,7 @@ CategoryList.reopenClass({ const categories = CategoryList.create(); const list = Discourse.Category.list(); - let statPeriod; + let statPeriod = "all"; const minCategories = result.category_list.categories.length * 0.66; ["week", "month"].some(period => { @@ -37,6 +37,8 @@ CategoryList.reopenClass({ c.topics = c.topics.map(t => Discourse.Topic.create(t)); } + c["pick" + statPeriod[0].toUpperCase() + statPeriod.slice(1)] = true; + switch(statPeriod) { case "week": case "month": diff --git a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 index 5a0e1d5a052..13fecc98f80 100644 --- a/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery-categories.js.es6 @@ -17,7 +17,7 @@ const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, { }, model() { - const style = this.siteSettings.desktop_category_page_style; + const style = !this.site.mobileView && this.siteSettings.desktop_category_page_style; const parentCategory = this.get("model.parentCategory"); let promise; diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs b/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs index 34a6e99a27e..6cb0f8c038b 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs @@ -33,9 +33,17 @@