From e6ba3344fa72e6b750c7ae984ef71ba252372111 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 26 Mar 2015 11:08:12 -0400 Subject: [PATCH] UX: Display unread underneath description on categories page if logo --- .../templates/components/category-unread.hbs | 6 ++++++ .../templates/discovery/categories.hbs | 20 ++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 app/assets/javascripts/discourse/templates/components/category-unread.hbs diff --git a/app/assets/javascripts/discourse/templates/components/category-unread.hbs b/app/assets/javascripts/discourse/templates/components/category-unread.hbs new file mode 100644 index 00000000000..7cdd8913c4d --- /dev/null +++ b/app/assets/javascripts/discourse/templates/components/category-unread.hbs @@ -0,0 +1,6 @@ +{{#if category.unreadTopics}} + {{i18n 'filters.unread.lower_title_with_count' count=category.unreadTopics}} +{{/if}} +{{#if category.newTopics}} + {{i18n 'filters.new.lower_title_with_count' count=category.newTopics}} +{{/if}} diff --git a/app/assets/javascripts/discourse/templates/discovery/categories.hbs b/app/assets/javascripts/discourse/templates/discovery/categories.hbs index 2612f25f5b2..3fdfdafd990 100644 --- a/app/assets/javascripts/discourse/templates/discovery/categories.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/categories.hbs @@ -15,12 +15,9 @@
{{category-title-link category=c}} - {{#if c.unreadTopics}} - {{i18n 'filters.unread.lower_title_with_count' count=c.unreadTopics}} - {{/if}} - {{#if c.newTopics}} - {{i18n 'filters.new.lower_title_with_count' count=c.newTopics}} - {{/if}} + {{#unless c.logo_url}} + {{category-unread category=c}} + {{/unless}}
@@ -28,17 +25,16 @@
{{{c.description_excerpt}}}
+ + {{#if c.logo_url}} + {{category-unread category=c}} + {{/if}} {{/if}} {{#if c.subcategories}}
{{#each s in c.subcategories}} {{category-link s hideParent="true"}} - {{#if s.unreadTopics}} - {{unbound s.unreadTopics}} - {{/if}} - {{#if s.newTopics}} - {{unbound s.newTopics}} - {{/if}} + {{category-unread category=s}} {{/each}}
{{/if}}