diff options
Diffstat (limited to 'client')
-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 () { |