You must give a reason for suspending a user
This commit is contained in:
parent
612001aa74
commit
dc77e7e27c
|
@ -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;
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-danger' {{action suspend}}><i class='fa fa-ban'></i>{{i18n admin.user.suspend}}</button>
|
||||
<button class='btn btn-danger' {{action suspend}} {{bind-attr disabled="submitDisabled"}}><i class='fa fa-ban'></i>{{i18n admin.user.suspend}}</button>
|
||||
<a {{action closeModal}}>{{i18n cancel}}</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue