FIX: display old category style on mobile

This commit is contained in:
Sam 2016-09-01 15:57:23 +10:00
parent c9422462be
commit 1d7df97c30
4 changed files with 16 additions and 4 deletions

View File

@ -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":

View File

@ -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;

View File

@ -33,9 +33,17 @@
</table>
<footer class="clearfix">
<figure title="{{i18n 'year_desc'}}">{{number c.topics_year}} <figcaption>{{i18n 'category.this_year'}}</figcaption></figure>
{{#if c.pickAll}}
<figure title="{{i18n 'all_time_desc'}}">{{number c.topics_all_time}} <figcaption>{{i18n 'all_time'}}</figcaption></figure>
{{/if}}
{{#if c.pickMonth}}
<figure title="{{i18n 'month_desc'}}">{{number c.topics_month}} <figcaption>{{i18n 'month'}}</figcaption></figure>
<figure title="{{i18n 'week_desc'}}">{{number c.topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure>
{{/if}}
{{#if c.pickWeek}}
<figure title="{{i18n 'week_desc'}}">{{number c.topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure>
{{/if}}
{{#if c.can_edit}}
<a href {{action "editCategory" c}} class='btn btn-small'>{{i18n 'category.edit'}}</a>

View File

@ -887,6 +887,8 @@ en:
learn_more: "learn more..."
all_time: 'total'
all_time_desc: 'total topics created'
year: 'year'
year_desc: 'topics created in the last 365 days'
month: 'month'