FIX: display old category style on mobile
This commit is contained in:
parent
c9422462be
commit
1d7df97c30
|
@ -13,7 +13,7 @@ CategoryList.reopenClass({
|
||||||
const categories = CategoryList.create();
|
const categories = CategoryList.create();
|
||||||
const list = Discourse.Category.list();
|
const list = Discourse.Category.list();
|
||||||
|
|
||||||
let statPeriod;
|
let statPeriod = "all";
|
||||||
const minCategories = result.category_list.categories.length * 0.66;
|
const minCategories = result.category_list.categories.length * 0.66;
|
||||||
|
|
||||||
["week", "month"].some(period => {
|
["week", "month"].some(period => {
|
||||||
|
@ -37,6 +37,8 @@ CategoryList.reopenClass({
|
||||||
c.topics = c.topics.map(t => Discourse.Topic.create(t));
|
c.topics = c.topics.map(t => Discourse.Topic.create(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c["pick" + statPeriod[0].toUpperCase() + statPeriod.slice(1)] = true;
|
||||||
|
|
||||||
switch(statPeriod) {
|
switch(statPeriod) {
|
||||||
case "week":
|
case "week":
|
||||||
case "month":
|
case "month":
|
||||||
|
|
|
@ -17,7 +17,7 @@ const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, {
|
||||||
},
|
},
|
||||||
|
|
||||||
model() {
|
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");
|
const parentCategory = this.get("model.parentCategory");
|
||||||
|
|
||||||
let promise;
|
let promise;
|
||||||
|
|
|
@ -33,9 +33,17 @@
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<footer class="clearfix">
|
<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 'month_desc'}}">{{number c.topics_month}} <figcaption>{{i18n 'month'}}</figcaption></figure>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if c.pickWeek}}
|
||||||
<figure title="{{i18n 'week_desc'}}">{{number c.topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure>
|
<figure title="{{i18n 'week_desc'}}">{{number c.topics_week}} <figcaption>{{i18n 'week'}}</figcaption></figure>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if c.can_edit}}
|
{{#if c.can_edit}}
|
||||||
<a href {{action "editCategory" c}} class='btn btn-small'>{{i18n 'category.edit'}}</a>
|
<a href {{action "editCategory" c}} class='btn btn-small'>{{i18n 'category.edit'}}</a>
|
||||||
|
|
|
@ -887,6 +887,8 @@ en:
|
||||||
|
|
||||||
learn_more: "learn more..."
|
learn_more: "learn more..."
|
||||||
|
|
||||||
|
all_time: 'total'
|
||||||
|
all_time_desc: 'total topics created'
|
||||||
year: 'year'
|
year: 'year'
|
||||||
year_desc: 'topics created in the last 365 days'
|
year_desc: 'topics created in the last 365 days'
|
||||||
month: 'month'
|
month: 'month'
|
||||||
|
|
Loading…
Reference in New Issue