diff --git a/app/assets/javascripts/discourse/components/topic_status_component.js b/app/assets/javascripts/discourse/components/topic_status_component.js index 249fd4aa426..d136673d419 100644 --- a/app/assets/javascripts/discourse/components/topic_status_component.js +++ b/app/assets/javascripts/discourse/components/topic_status_component.js @@ -9,8 +9,8 @@ Discourse.TopicStatusComponent = Ember.Component.extend({ classNames: ['topic-statuses'], - hasDisplayableStatus: Em.computed.or('topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault'), - shouldRerender: Discourse.View.renderIfChanged('topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned'), + hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault'), + shouldRerender: Discourse.View.renderIfChanged('topic.archived','topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned'), didInsertElement: function(){ var self = this; @@ -18,10 +18,6 @@ Discourse.TopicStatusComponent = Ember.Component.extend({ this.$('a').click(function(){ var topic = self.get('topic'); - // could be passed in a controller - if(topic.constructor && topic.constructor.toString() !== 'Discourse.Topic') { - topic = topic.get('model'); - } // only pin unpin for now if (topic.get('pinned')) { topic.clearPin(); @@ -56,6 +52,7 @@ Discourse.TopicStatusComponent = Ember.Component.extend({ }; renderIconIf('topic.closed', 'lock', 'locked'); + renderIconIf('topic.archived', 'lock', 'archived'); renderIconIf('topic.pinned', 'thumb-tack', 'pinned', togglePin); renderIconIf('topic.unpinned', 'thumb-tack unpinned', 'unpinned', togglePin); renderIconIf('topic.invisible', 'eye-slash', 'invisible'); diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars index 2b292d26bad..65c7898a874 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars +++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.js.handlebars @@ -11,7 +11,7 @@ {{/if}} - {{topicStatus topic=this}} + {{topicStatus topic=this.model}} {{{topicLink this}}} {{#if unread}} {{unread}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d28682dbe25..15dbfbffbbb 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1145,6 +1145,8 @@ en: topic_statuses: locked: help: "This topic is closed; it no longer accepts new replies" + archived: + help: "This topic is archived; it no longer accepts new replies" unpinned: title: "Unpinned" help: "This topic is unpinned; it will display in default order"