diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-09 17:51:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-09 17:55:05 +0200 |
commit | 141b177db088891e84040f68aa95008fb52f1d44 (patch) | |
tree | 20168077514c920f5b4da4696707db55f51b158d /client/src/app/shared/forms | |
parent | 63347a0ff966c7863e5b7431effa1cb0668df893 (diff) | |
download | PeerTube-141b177db088891e84040f68aa95008fb52f1d44.tar.gz PeerTube-141b177db088891e84040f68aa95008fb52f1d44.tar.zst PeerTube-141b177db088891e84040f68aa95008fb52f1d44.zip |
Add ability to ban/unban users
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r-- | client/src/app/shared/forms/form-validators/user-validators.service.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/user-validators.service.ts b/client/src/app/shared/forms/form-validators/user-validators.service.ts index 5edae2e38..ec9566ef3 100644 --- a/client/src/app/shared/forms/form-validators/user-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/user-validators.service.ts | |||
@@ -14,6 +14,8 @@ export class UserValidatorsService { | |||
14 | readonly USER_DESCRIPTION: BuildFormValidator | 14 | readonly USER_DESCRIPTION: BuildFormValidator |
15 | readonly USER_TERMS: BuildFormValidator | 15 | readonly USER_TERMS: BuildFormValidator |
16 | 16 | ||
17 | readonly USER_BAN_REASON: BuildFormValidator | ||
18 | |||
17 | constructor (private i18n: I18n) { | 19 | constructor (private i18n: I18n) { |
18 | 20 | ||
19 | this.USER_USERNAME = { | 21 | this.USER_USERNAME = { |
@@ -99,5 +101,16 @@ export class UserValidatorsService { | |||
99 | 'required': this.i18n('You must to agree with the instance terms in order to registering on it.') | 101 | 'required': this.i18n('You must to agree with the instance terms in order to registering on it.') |
100 | } | 102 | } |
101 | } | 103 | } |
104 | |||
105 | this.USER_BAN_REASON = { | ||
106 | VALIDATORS: [ | ||
107 | Validators.minLength(3), | ||
108 | Validators.maxLength(250) | ||
109 | ], | ||
110 | MESSAGES: { | ||
111 | 'minlength': this.i18n('Ban reason must be at least 3 characters long.'), | ||
112 | 'maxlength': this.i18n('Ban reason cannot be more than 250 characters long.') | ||
113 | } | ||
114 | } | ||
102 | } | 115 | } |
103 | } | 116 | } |