mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-28 23:14:04 -04:00
Don't render 'Reply' button when user can't post
This commit is contained in:
parent
067b220a62
commit
8447fd47e5
2 changed files with 3 additions and 3 deletions
app/assets/javascripts/discourse/views
|
@ -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…
Add table
Add a link
Reference in a new issue