UX: adjust to show all and stat period

This commit is contained in:
Sam 2016-09-02 11:03:52 +10:00
parent 1078d929cd
commit 034dc52beb
2 changed files with 4 additions and 4 deletions

View file

@ -37,7 +37,6 @@ 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":
@ -47,11 +46,13 @@ CategoryList.reopenClass({
if (stat > 0) {
c.stat = `<span class="value">${stat}</span> / <span class="unit">${unit}</span>`;
c.statTitle = I18n.t("categories.topic_stat_sentence", { count: stat, unit: unit });
c["pick" + statPeriod[0].toUpperCase() + statPeriod.slice(1)] = true;
break;
}
default:
c.stat = `<span class="value">${c.topics_all_time}</span>`;
c.statTitle = I18n.t("categories.topic_sentence", { count: c.topics_all_time });
c.pickAll = true;
break;
}

View file

@ -33,9 +33,8 @@
</table>
<footer class="clearfix">
{{#if c.pickAll}}
<figure title="{{i18n 'all_time_desc'}}">{{number c.topics_all_time}} <figcaption>{{i18n 'all_time'}}</figcaption></figure>
{{/if}}
<figure title="{{i18n 'all_time_desc'}}">{{number c.topics_all_time}} <figcaption>{{i18n 'all_time'}}</figcaption></figure>
{{#if c.pickMonth}}
<figure title="{{i18n 'month_desc'}}">{{number c.topics_month}} <figcaption>{{i18n 'month'}}</figcaption></figure>