diff --git a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 index e3d2e89a8b7..b0dfc941ca1 100644 --- a/app/assets/javascripts/discourse/routes/build-category-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-category-route.js.es6 @@ -63,9 +63,15 @@ export default (filter, params) => { setupController(controller, model) { const topics = this.get('topics'), - periodId = topics.get('for_period') || (filter.indexOf('/') > 0 ? filter.split('/')[1] : ''); + periodId = topics.get('for_period') || (filter.indexOf('/') > 0 ? filter.split('/')[1] : ''), + canCreateTopic = topics.get('can_create_topic'), + canCreateTopicOnCategory = model.get('permission') === Discourse.PermissionType.FULL; - this.controllerFor('navigation/category').set('canCreateTopic', topics.get('can_create_topic')); + this.controllerFor('navigation/category').setProperties({ + canCreateTopicOnCategory: canCreateTopicOnCategory, + cannotCreateTopicOnCategory: !canCreateTopicOnCategory, + canCreateTopic: canCreateTopic + }); this.controllerFor('discovery/topics').setProperties({ model: topics, category: model, @@ -74,7 +80,9 @@ export default (filter, params) => { noSubcategories: params && !!params.no_subcategories, order: topics.get('params.order'), ascending: topics.get('params.ascending'), - expandAllPinned: true + expandAllPinned: true, + canCreateTopic: canCreateTopic, + canCreateTopicOnCategory: canCreateTopicOnCategory }); this.searchService.set('searchContext', model.get('searchContext')); diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs index f3e452a4ab0..9ed3a83d177 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs @@ -67,7 +67,7 @@