]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+login/login.component.html
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / client / src / app / +login / login.component.html
index 834ea6e51cd359f8249760d91287b3134be9a118..5d267f168e9b6cc813e17b10ec8a574ac73c9825 100644 (file)
       </h5>
 
       <p *ngIf="signupAllowed" i18n>
-        This instance allows registration. However, be careful to check the <a class="link-orange terms-anchor" (click)="onTermsClick($event, instanceInformation)" href='#'>Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> before creating an account.
+        This instance allows registration. However, be careful to check the <a class="link-orange terms-anchor d-inline" (click)="onTermsClick($event, instanceInformation)" href='#'>Terms</a><a class="terms-link" target="_blank" routerLink="/about/instance" fragment="terms">Terms</a> before creating an account.
         You may also search for another instance to match your exact needs at: <a class="link-orange" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
       </p>
 
       <p *ngIf="!signupAllowed" i18n>
-        Currently this instance doesn't allow for user registration, you may check the <a (click)="onTermsClick($event, instanceInformation)" href='#'>Terms</a> for more details or find an instance that gives you the possibility to sign up for an account and upload your videos there.
+        Currently this instance doesn't allow for user registration, you may check the <a class="link-orange" (click)="onTermsClick($event, instanceInformation)" href='#'>Terms</a> for more details or find an instance that gives you the possibility to sign up for an account and upload your videos there.
         Find yours among multiple instances at: <a class="link-orange" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>.
       </p>
     </div>
     <div class="wrapper">
       <div class="login-form-and-externals">
 
-        <form myPluginSelector pluginSelectorId="login-form" role="form" (ngSubmit)="login()" [formGroup]="form">
-          <div class="form-group">
-            <div>
-              <label i18n for="username">Username or email address</label>
-              <input
-                type="text" id="username" i18n-placeholder placeholder="Example: john@example.com" required tabindex="1"
-                formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" myAutofocus
-              >
+        <form class="w-100 m-0" myPluginSelector pluginSelectorId="login-form" role="form" (ngSubmit)="login()" [formGroup]="form">
+          <ng-container *ngIf="!otpStep">
+            <div class="form-group">
+              <div>
+                <label i18n for="username">Username or email address</label>
+                <input
+                  type="text" id="username" i18n-placeholder placeholder="Example: john@example.com" required tabindex="1"
+                  formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" myAutofocus
+                >
+              </div>
+
+              <div *ngIf="formErrors.username" class="form-error">{{ formErrors.username }}</div>
+
+              <div *ngIf="hasUsernameUppercase()" i18n class="form-warning">
+                ⚠️ Most email addresses do not include capital letters.
+              </div>
             </div>
 
-            <div *ngIf="formErrors.username" class="form-error">{{ formErrors.username }}</div>
+            <div class="form-group">
+              <label i18n for="password">Password</label>
 
-            <div *ngIf="hasUsernameUppercase()" i18n class="form-warning">
-              ⚠️ Most email addresses do not include capital letters.
+              <my-input-text
+                formControlName="password" inputId="password" i18n-placeholder placeholder="Password"
+                [formError]="formErrors['password']" autocomplete="current-password" [tabindex]="2"
+              ></my-input-text>
             </div>
-          </div>
+          </ng-container>
 
-          <div class="form-group">
-            <label i18n for="password">Password</label>
+          <div *ngIf="otpStep" class="form-group">
+            <p i18n>Enter the two-factor code generated by your phone app:</p>
 
-            <my-input-text formControlName="password" inputId="password"
-                                    i18n-placeholder placeholder="Password"
-                                    [ngClass]="{ 'input-error': formErrors['password'] }"
-                                    autocomplete="current-password" [tabindex]="2"></my-input-text>
+            <label i18n for="otp-token">Two factor authentication token</label>
 
-            <div *ngIf="formErrors.password" class="form-error">{{ formErrors.password }}</div>
+            <my-input-text
+              #otpTokenInput
+              [show]="true" formControlName="otp-token" inputId="otp-token"
+              [formError]="formErrors['otp-token']" autocomplete="otp-token"
+            ></my-input-text>
           </div>
 
-          <input type="submit" class="peertube-button orange-button" i18n-value value="Login" [disabled]="!form.valid">
+          <input type="submit" class="peertube-button orange-button w-100" i18n-value value="Login" [disabled]="!form.valid">
 
-          <div class="additional-links">
-            <a i18n role="button" class="link-orange" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">I forgot my password</a>
+          <div *ngIf="!otpStep" class="additional-links d-flex justify-content-center mt-4 mb-5">
+            <button i18n class="button-unstyle link-orange mx-3" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">
+              I forgot my password
+            </button>
 
             <ng-container *ngIf="signupAllowed">
-              <span>·</span>
-              <a i18n routerLink="/signup" class="link-orange">Create an account</a>
+              <span class="lh-1">·</span>
+              <a i18n routerLink="/signup" class="link-orange mx-3">Create an account</a>
             </ng-container>
           </div>
         </form>
 
         <div class="external-login-blocks" *ngIf="getExternalLogins().length !== 0">
-          <div class="block-title" i18n>Or sign in with</div>
+          <div class="fw-semibold" i18n>Or sign in with</div>
 
           <div>
             <a class="external-login-block" *ngFor="let auth of getExternalLogins()" [href]="getAuthHref(auth)" role="button">
 
       <div #instanceInformation class="instance-information">
         <my-instance-about-accordion
+          #instanceAboutAccordion
           [displayInstanceName]="false"
           (init)="onInstanceAboutAccordionInit($event)" [panels]="instanceInformationPanels"
           pluginScope="login" pluginHook="filter:login.instance-about-plugin-panels.create.result"
     <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideForgotPasswordModal()"></my-global-icon>
   </div>
 
-  <div class="modal-body">
+  <div class="modal-body text-start">
 
     <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n>
       We are sorry, you cannot recover your password because your instance administrator did not configure the PeerTube email system.
     </div>
 
-    <div *ngIf="!isEmailDisabled()" class="forgot-password-instructions" i18n>
+    <div *ngIf="!isEmailDisabled()" class="mb-4" i18n>
       Enter your email address and we will send you a link to reset your password.
     </div>
 
 
   <div class="modal-footer inputs">
     <input
-      type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button"
+      type="button" role="button" i18n-value value="Cancel" class="peertube-button d-none d-sm-block"
       (click)="hideForgotPasswordModal()" (key.enter)="hideForgotPasswordModal()"
     >