diff --git a/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars b/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars index b810be7caa7..3ef9fe7dd89 100644 --- a/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars +++ b/app/assets/javascripts/discourse/templates/featured_topics.js.handlebars @@ -7,24 +7,24 @@ {{#each featured_users}} {{avatar this imageSize="small"}} {{/each}} - + {{i18n posts}} {{i18n age}} - + {{#each topics}}
- {{view Discourse.TopicStatusView topicBinding="this"}} - {{{topicLink this}} + {{view Discourse.TopicStatusView topicBinding="this"}} + {{{topicLink this}} {{#if unread}} {{unbound unread}} {{/if}} {{#if new_posts}} {{unbound new_posts}} - {{/if}} + {{/if}}
{{number posts_count}} diff --git a/app/assets/javascripts/discourse/views/topic_status_view.js b/app/assets/javascripts/discourse/views/topic_status_view.js index 120d9eefdbf..bef725ebc81 100644 --- a/app/assets/javascripts/discourse/views/topic_status_view.js +++ b/app/assets/javascripts/discourse/views/topic_status_view.js @@ -9,25 +9,25 @@ Discourse.TopicStatusView = Discourse.View.extend({ classNames: ['topic-statuses'], - hasDisplayableStatus: (function() { + hasDisplayableStatus: function() { if (this.get('topic.closed')) return true; if (this.get('topic.pinned')) return true; if (!this.get('topic.archetype.isDefault')) return true; if (!this.get('topic.visible')) return true; return false; - }).property('topic.closed', 'topic.pinned', 'topic.visible'), + }.property('topic.closed', 'topic.pinned', 'topic.visible'), - statusChanged: (function() { + statusChanged: function() { this.rerender(); - }).observes('topic.closed', 'topic.pinned', 'topic.visible'), + }.observes('topic.closed', 'topic.pinned', 'topic.visible'), renderIcon: function(buffer, name, key) { - var title; - title = Em.String.i18n("topic_statuses." + key + ".help"); + var title = Em.String.i18n("topic_statuses." + key + ".help"); return buffer.push(""); }, render: function(buffer) { + if (!this.get('hasDisplayableStatus')) return; // Allow a plugin to add a custom icon to a topic