From dc77e7e27c6f2aaecdffe2ce1535e07ae0e4112e Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 4 Feb 2014 11:03:35 -0500 Subject: [PATCH] You must give a reason for suspending a user --- .../admin/controllers/admin_suspend_user_controller.js | 5 +++++ .../admin/templates/modal/admin_suspend_user.js.handlebars | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/controllers/admin_suspend_user_controller.js b/app/assets/javascripts/admin/controllers/admin_suspend_user_controller.js index 0f4c1625ffd..14d9c862a98 100644 --- a/app/assets/javascripts/admin/controllers/admin_suspend_user_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_suspend_user_controller.js @@ -9,8 +9,13 @@ **/ Discourse.AdminSuspendUserController = Discourse.ObjectController.extend(Discourse.ModalFunctionality, { + submitDisabled: function() { + return (!this.get('reason') || this.get('reason').length < 1); + }.property('reason'), + actions: { suspend: function() { + if (this.get('submitDisabled')) return; var duration = parseInt(this.get('duration'), 10); if (duration > 0) { var self = this; diff --git a/app/assets/javascripts/admin/templates/modal/admin_suspend_user.js.handlebars b/app/assets/javascripts/admin/templates/modal/admin_suspend_user.js.handlebars index 3bd276926ca..34a414cd072 100644 --- a/app/assets/javascripts/admin/templates/modal/admin_suspend_user.js.handlebars +++ b/app/assets/javascripts/admin/templates/modal/admin_suspend_user.js.handlebars @@ -10,6 +10,6 @@