From e37c4a452569386389af67151d78ca0a990aeb6d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 16 Nov 2018 10:59:52 -0500 Subject: [PATCH] FIX: Don't show the Quote popup if posting is disabled --- .../javascripts/discourse/controllers/topic.js.es6 | 9 +++++++++ app/assets/javascripts/discourse/templates/topic.hbs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index 5b26e389ebf..d30dfee5733 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -70,6 +70,15 @@ export default Ember.Controller.extend(BufferedContent, { } }, + @computed("model.details.can_create_post") + embedQuoteButton(canCreatePost) { + return ( + canCreatePost && + this.currentUser && + this.currentUser.get("enable_quoting") + ); + }, + @computed("model.postStream.loaded", "model.category_id") showSharedDraftControls(loaded, categoryId) { let draftCat = this.site.shared_drafts_category_id; diff --git a/app/assets/javascripts/discourse/templates/topic.hbs b/app/assets/javascripts/discourse/templates/topic.hbs index 40e3db1c69a..400a7efb4de 100644 --- a/app/assets/javascripts/discourse/templates/topic.hbs +++ b/app/assets/javascripts/discourse/templates/topic.hbs @@ -322,7 +322,7 @@ {{share-popup topic=model replyAsNewTopic="replyAsNewTopic"}} - {{#if currentUser.enable_quoting}} + {{#if embedQuoteButton}} {{quote-button quoteState=quoteState selectText=(action "selectText")}} {{/if}} {{/discourse-topic}}