forked from Chocobozzz/PeerTube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Divide login flow into two steps
related to Chocobozzz#6858
- Loading branch information
1 parent
94a7879
commit aaff1d7
Showing
2 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,10 @@ <h5 class="alert-heading" i18n> | |
|
||
<form class="w-100 m-0" myPluginSelector pluginSelectorId="login-form" (ngSubmit)="login()" [formGroup]="form"> | ||
<ng-container *ngIf="!otpStep"> | ||
<div class="form-group"> | ||
<div class="form-group" *ngIf="currentLoginStep == 1"> | ||
<div> | ||
<label i18n for="username">Username or email address</label> | ||
<input | ||
type="text" id="username" i18n-placeholder placeholder="Example: [email protected]" required | ||
type="text" id="username" i18n-placeholder placeholder="Email or username" required | ||
formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" myAutofocus | ||
autocomplete="username" | ||
> | ||
|
@@ -59,11 +58,9 @@ <h5 class="alert-heading" i18n> | |
<ng-template *ngIf="hasUsernameUppercase()" [ngTemplateOutlet]="uppercaseWarning"></ng-template> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label i18n for="password">Password</label> | ||
|
||
<div class="form-group" *ngIf="currentLoginStep == 2"> | ||
<my-input-text | ||
formControlName="password" inputId="password" i18n-placeholder placeholder="Password" | ||
formControlName="password" inputId="password" i18n-placeholder placeholder="Password" [autofocus]="true" | ||
[formError]="formErrors['password']" autocomplete="current-password" | ||
></my-input-text> | ||
</div> | ||
|
@@ -81,7 +78,7 @@ <h5 class="alert-heading" i18n> | |
></my-input-text> | ||
</div> | ||
|
||
<input type="submit" class="peertube-button primary-button w-100" i18n-value value="Login" [disabled]="!form.valid"> | ||
<input type="submit" class="peertube-button primary-button w-100" i18n-value [value]="currentLoginStep === 1 ? 'Next' : 'Login'" [disabled]="!isFormValid()"> | ||
|
||
<div *ngIf="!otpStep" class="additional-links d-flex justify-content-center mt-4 mb-5 text-center"> | ||
<button type="button" i18n class="button-unstyle link-primary mx-3" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters