Merge pull request #1950 from verg/master
Don't render 'Reply' button when user can't post
This commit is contained in:
commit
90d20c4373
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue