mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Fix disabled button
This commit is contained in:
parent
449ebe4b54
commit
4888717c09
2 changed files with 22 additions and 12 deletions
|
@ -13,23 +13,27 @@
|
|||
<form novalidate [formGroup]="form" (ngSubmit)="processRegistration()">
|
||||
<div class="modal-body mb-3">
|
||||
|
||||
<my-alert i18n *ngIf="!registration.emailVerified" type="warning">
|
||||
Registration email has not been verified. Email delivery has been disabled by default.
|
||||
</my-alert>
|
||||
|
||||
<div class="description">
|
||||
<ng-container *ngIf="isAccept()">
|
||||
<p i18n>
|
||||
<strong>Accepting</strong> <em>{{ registration.username }}</em> registration will create the account and channel.
|
||||
</p>
|
||||
|
||||
<p *ngIf="isEmailEnabled()" i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
|
||||
An email will be sent to <em>{{ registration.email }}</em> explaining its account has been created with the moderation response you'll write below.
|
||||
</p>
|
||||
|
||||
<my-alert *ngIf="!isEmailEnabled()" type="warning" i18n>
|
||||
Emails are not enabled on this instance so PeerTube won't be able to send an email to <em>{{ registration.email }}</em> explaining its account has been created.
|
||||
</my-alert>
|
||||
@if (isEmailEnabled()) {
|
||||
@if (!registration.emailVerified) {
|
||||
<my-alert i18n type="warning">
|
||||
Registration email has not been verified. Email delivery has been disabled by default.
|
||||
</my-alert>
|
||||
} @else {
|
||||
<p i18n [ngClass]="{ 'text-decoration-line-through': isPreventEmailDeliveryChecked() }">
|
||||
An email will be sent to <em>{{ registration.email }}</em> explaining its account has been created with the moderation response you'll write below.
|
||||
</p>
|
||||
}
|
||||
} @else {
|
||||
<my-alert type="warning" i18n>
|
||||
Emails are not enabled on this instance so PeerTube won't be able to send an email to <em>{{ registration.email }}</em> explaining its account has been created.
|
||||
</my-alert>
|
||||
}
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isReject()">
|
||||
|
@ -58,7 +62,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<my-peertube-checkbox
|
||||
inputName="preventEmailDelivery" formControlName="preventEmailDelivery" [disabled]="!isEmailEnabled()"
|
||||
inputName="preventEmailDelivery" formControlName="preventEmailDelivery"
|
||||
i18n-labelText labelText="Prevent email from being sent to the user"
|
||||
></my-peertube-checkbox>
|
||||
</div>
|
||||
|
|
|
@ -53,6 +53,12 @@ export class ProcessRegistrationModalComponent extends FormReactive implements O
|
|||
this.processMode = mode
|
||||
this.registration = registration
|
||||
|
||||
if (this.registration.emailVerified !== true || !this.isEmailEnabled()) {
|
||||
this.form.get('preventEmailDelivery').disable()
|
||||
} else {
|
||||
this.form.get('preventEmailDelivery').enable()
|
||||
}
|
||||
|
||||
this.form.patchValue({
|
||||
preventEmailDelivery: !this.isEmailEnabled() || registration.emailVerified !== true
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue