From 29d2f04d87102281f8d6f0e079e55eb1b9c36a92 Mon Sep 17 00:00:00 2001 From: tms Date: Sun, 10 Feb 2013 22:15:40 -0500 Subject: [PATCH] Disable reply button on archived/closed topics --- .../discourse/views/topic_footer_buttons_view.js.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js.coffee b/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js.coffee index 4c9d4c604ee..f2b41fc8bf9 100644 --- a/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js.coffee +++ b/app/assets/javascripts/discourse/views/topic_footer_buttons_view.js.coffee @@ -38,6 +38,7 @@ window.Discourse.TopicFooterButtonsView = Ember.ContainerView.extend @addObject Discourse.ButtonView.createWithMixins classNames: ['btn', 'btn-primary', 'create'] + attributeBindings: ['disabled'] text: (-> archetype = @get('controller.content.archetype') return customTitle if customTitle = @get("parentView.replyButtonText#{archetype.capitalize()}") @@ -46,6 +47,7 @@ window.Discourse.TopicFooterButtonsView = Ember.ContainerView.extend renderIcon: (buffer) -> buffer.push("") click: -> @get('controller').reply() helpKey: 'topic.reply.help' + disabled: !@get('controller.content.can_create_post') unless topic.get('isPrivateMessage') @addObject Discourse.DropdownButtonView.createWithMixins