diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index b0940bea272..6b62f5bb670 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -42,6 +42,7 @@ Discourse.ComposerController = Discourse.Controller.extend({ if( composer.get('cantSubmitPost') ) { this.set('view.showTitleTip', true); + this.set('view.showCategoryTip', true); this.set('view.showReplyTip', true); return; } @@ -336,6 +337,7 @@ Discourse.ComposerController = Discourse.Controller.extend({ this.set('content', null); this.set('view.content', null); this.set('view.showTitleTip', false); + this.set('view.showCategoryTip', false); this.set('view.showReplyTip', false); }, diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index 68ceff6f64b..860c31ef2de 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -172,8 +172,10 @@ Discourse.Composer = Discourse.Model.extend({ // reply is always required if (this.get('replyLength') < Discourse.SiteSettings.min_post_length) return true; + if (!Discourse.SiteSettings.allow_uncategorized_topics && !this.get('categoryName')) return true; + return false; - }.property('loading', 'editTitle', 'titleLength', 'targetUsernames', 'replyLength'), + }.property('loading', 'editTitle', 'titleLength', 'targetUsernames', 'replyLength', 'categoryName'), // The text for the save button saveText: function() { diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index aab1e64fed9..d96650b23d8 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -39,7 +39,10 @@ {{#unless content.creatingPrivateMessage}} - {{view Discourse.ComboboxViewCategory valueAttribute="name" contentBinding="categories" valueBinding="content.categoryName"}} +