add previous button to registration form, with alignment

pull/3435/head
Rigel Kent 2020-12-09 13:20:58 +01:00
parent 23cd3129a9
commit e0fea785bf
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
3 changed files with 16 additions and 6 deletions

View File

@ -26,15 +26,15 @@
<cdk-step [stepControl]="formStepUser" i18n-label="Stepper label for the registration page asking user informations" label="User">
<my-register-step-user (formBuilt)="onUserFormBuilt($event)" [videoUploadDisabled]="videoUploadDisabled"></my-register-step-user>
<button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
<button cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid" (click)="videoUploadDisabled && signup()">{{ stepUserButtonLabel }}</button>
</cdk-step>
<cdk-step [stepControl]="formStepChannel" i18n-label="Stepper label for the registration page asking information about the default channel" label="Channel" *ngIf="!videoUploadDisabled">
<my-register-step-channel (formBuilt)="onChannelFormBuilt($event)" [username]="getUsername()"></my-register-step-channel>
<button i18n cdkStepperNext (click)="signup()"
[disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()"
>
<button cdkStepperPrevious>{{ defaultPreviousStepButtonLabel }}</button>
<button cdkStepperNext [disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()" (click)="signup()" i18n>
Create my account
</button>
</cdk-step>

View File

@ -55,7 +55,16 @@ input:not([type=submit]) {
input[type=submit],
button {
@include peertube-button;
@include orange-button;
&[cdkStepperNext] {
@include orange-button;
float: inline-end;
}
&[cdkStepperPrevious] {
@include grey-button;
float: inline-start;
}
}
.name-information {

View File

@ -38,7 +38,8 @@ export class RegisterComponent implements OnInit {
moderation: false
}
defaultNextStepButtonLabel = $localize`Next`
defaultPreviousStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Back`
defaultNextStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Next`
stepUserButtonLabel = this.defaultNextStepButtonLabel
private serverConfig: ServerConfig
@ -60,7 +61,7 @@ export class RegisterComponent implements OnInit {
this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
this.stepUserButtonLabel = this.videoUploadDisabled
? $localize`Signup`
? $localize`:Button on the registration form to finalize the account and channel creation:Signup`
: this.defaultNextStepButtonLabel
this.hooks.runAction('action:signup.register.init', 'signup')