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

View file

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