diff options
author | The Cashew Trader <81344401+thecashewtrader@users.noreply.github.com> | 2022-01-14 19:40:27 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 15:10:27 +0100 |
commit | 884b17773d113d71472fe86f7076087c784943a6 (patch) | |
tree | 20c9ccde9a90f782347ef3c0d3b83f2aeff52a51 | |
parent | ff4d2c73fd5a8ab08a5a5c2655eb91c96d39687e (diff) | |
download | PeerTube-884b17773d113d71472fe86f7076087c784943a6.tar.gz PeerTube-884b17773d113d71472fe86f7076087c784943a6.tar.zst PeerTube-884b17773d113d71472fe86f7076087c784943a6.zip |
Fix user ban modal grammar to account for multiple users (#4722)
* Fix user ban modal grammar to account for multiple users
* Address variable sugggestion
* Address property syntax suggestion
* Address localization suggestion
* More concise `isSingleUser` declaration
-rw-r--r-- | client/src/app/shared/shared-moderation/user-ban-modal.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/shared-moderation/user-ban-modal.component.ts | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.html b/client/src/app/shared/shared-moderation/user-ban-modal.component.html index 7129b00ca..b41ae230d 100644 --- a/client/src/app/shared/shared-moderation/user-ban-modal.component.html +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.html | |||
@@ -27,7 +27,7 @@ | |||
27 | (click)="hide()" (key.enter)="hide()" | 27 | (click)="hide()" (key.enter)="hide()" |
28 | > | 28 | > |
29 | 29 | ||
30 | <input type="submit" i18n-value value="Ban this user" class="peertube-button orange-button" [disabled]="!form.valid" /> | 30 | <input type="submit" i18n-value [value]="modalMessage" class="peertube-button orange-button" [disabled]="!form.valid" /> |
31 | </div> | 31 | </div> |
32 | </form> | 32 | </form> |
33 | </div> | 33 | </div> |
diff --git a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts index a03bd7286..b2ce019c5 100644 --- a/client/src/app/shared/shared-moderation/user-ban-modal.component.ts +++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts | |||
@@ -17,6 +17,7 @@ export class UserBanModalComponent extends FormReactive implements OnInit { | |||
17 | 17 | ||
18 | private usersToBan: User | User[] | 18 | private usersToBan: User | User[] |
19 | private openedModal: NgbModalRef | 19 | private openedModal: NgbModalRef |
20 | modalMessage = '' | ||
20 | 21 | ||
21 | constructor ( | 22 | constructor ( |
22 | protected formValidatorService: FormValidatorService, | 23 | protected formValidatorService: FormValidatorService, |
@@ -36,6 +37,9 @@ export class UserBanModalComponent extends FormReactive implements OnInit { | |||
36 | openModal (user: User | User[]) { | 37 | openModal (user: User | User[]) { |
37 | this.usersToBan = user | 38 | this.usersToBan = user |
38 | this.openedModal = this.modalService.open(this.modal, { centered: true }) | 39 | this.openedModal = this.modalService.open(this.modal, { centered: true }) |
40 | |||
41 | const isSingleUser = !(Array.isArray(this.usersToBan) && this.usersToBan.length > 1) | ||
42 | this.modalMessage = isSingleUser ? $localize`Ban this user` : $localize`Ban these users` | ||
39 | } | 43 | } |
40 | 44 | ||
41 | hide () { | 45 | hide () { |