Merge pull request #1950 from verg/master

Don't render 'Reply' button when user can't post
This commit is contained in:
Régis Hanol 2014-02-17 14:04:49 +01:00
commit 90d20c4373
2 changed files with 3 additions and 3 deletions

View File

@ -8,9 +8,7 @@
**/ **/
Discourse.ReplyButton = Discourse.ButtonView.extend({ Discourse.ReplyButton = Discourse.ButtonView.extend({
classNames: ['btn', 'btn-primary', 'create'], classNames: ['btn', 'btn-primary', 'create'],
attributeBindings: ['disabled'],
helpKey: 'topic.reply.help', helpKey: 'topic.reply.help',
disabled: Em.computed.not('controller.model.details.can_create_post'),
text: function() { text: function() {
var archetypeCapitalized = this.get('controller.content.archetype').capitalize(); var archetypeCapitalized = this.get('controller.content.archetype').capitalize();

View File

@ -31,7 +31,9 @@ Discourse.TopicFooterButtonsView = Discourse.ContainerView.extend({
this.attachViewClass(Discourse.FlagTopicButton); this.attachViewClass(Discourse.FlagTopicButton);
} }
} }
this.attachViewClass(Discourse.ReplyButton); if (this.get('topic.details.can_create_post')) {
this.attachViewClass(Discourse.ReplyButton);
}
this.attachViewClass(Discourse.NotificationsButton); this.attachViewClass(Discourse.NotificationsButton);
this.trigger('additionalButtons', this); this.trigger('additionalButtons', this);