Kaynağa Gözat

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
tags/v4.1.0-rc.1
The Cashew Trader GitHub 4 ay önce
ebeveyn
işleme
884b17773d
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
2 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. +1
    -1
      client/src/app/shared/shared-moderation/user-ban-modal.component.html
  2. +4
    -0
      client/src/app/shared/shared-moderation/user-ban-modal.component.ts

+ 1
- 1
client/src/app/shared/shared-moderation/user-ban-modal.component.html Dosyayı Görüntüle

@@ -27,7 +27,7 @@
(click)="hide()" (key.enter)="hide()"
>

<input type="submit" i18n-value value="Ban this user" class="peertube-button orange-button" [disabled]="!form.valid" />
<input type="submit" i18n-value [value]="modalMessage" class="peertube-button orange-button" [disabled]="!form.valid" />
</div>
</form>
</div>


+ 4
- 0
client/src/app/shared/shared-moderation/user-ban-modal.component.ts Dosyayı Görüntüle

@@ -17,6 +17,7 @@ export class UserBanModalComponent extends FormReactive implements OnInit {

private usersToBan: User | User[]
private openedModal: NgbModalRef
modalMessage = ''

constructor (
protected formValidatorService: FormValidatorService,
@@ -36,6 +37,9 @@ export class UserBanModalComponent extends FormReactive implements OnInit {
openModal (user: User | User[]) {
this.usersToBan = user
this.openedModal = this.modalService.open(this.modal, { centered: true })

const isSingleUser = !(Array.isArray(this.usersToBan) && this.usersToBan.length > 1)
this.modalMessage = isSingleUser ? $localize`Ban this user` : $localize`Ban these users`
}

hide () {


Yükleniyor…
İptal
Kaydet