aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/login/login.component.html
blob: b7fd25d27dc32cc039bd0d76c2d8530304c74633 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                            
 
                                                                 
 

                                                            



















                                                                                                                                         
                                                          
                                 
            
          
 

                                            

              
                                                                                                    



                                                                                                          
                                                          
                                 
            
          
 

                                                                
      
































                                                                                                                  
<div class="margin-content">
  <div class="title-page title-page-single">
    Login
  </div>

  <div *ngIf="error" class="alert alert-danger">{{ error }}</div>

  <form role="form" (ngSubmit)="login()" [formGroup]="form">
    <div class="form-group">
      <div>
        <label for="username">User</label>
        <input
          type="text" id="username" placeholder="Username or email address" required tabindex="1"
          formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
        >
        <a *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
          or create an account
        </a>

        <a *ngIf="signupAllowed === false" href="https://joinpeertube.org/en/#getting-started" target="_blank" class="create-an-account">
          or create an account on another instance
        </a>

        <my-help
          *ngIf="signupAllowed === false" helpType="custom"
          customHtml="User registration is not allowed on this instance, but you can register on many others!"
        ></my-help>
      </div>

      <div *ngIf="formErrors.username" class="form-error">
        {{ formErrors.username }}
      </div>
    </div>

    <div class="form-group">
      <label for="password">Password</label>
      <div>
        <input
          type="password" name="password" id="password" placeholder="Password" required tabindex="2"
          formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
        >
        <div class="forgot-password-button" (click)="openForgotPasswordModal()">I forgot my password</div>
      </div>
      <div *ngIf="formErrors.password" class="form-error">
        {{ formErrors.password }}
      </div>
    </div>

    <input type="submit" value="Login" [disabled]="!form.valid">
  </form>
</div>

<div bsModal #forgotPasswordModal="bs-modal" (onShown)="onForgotPasswordModalShown()" class="modal" tabindex="-1">
  <div class="modal-dialog">
    <div class="modal-content">

      <div class="modal-header">
        <span class="close" aria-hidden="true" (click)="hideForgotPasswordModal()"></span>
        <h4 class="modal-title">Forgot your password</h4>
      </div>

      <div class="modal-body">
        <div class="form-group">
          <label for="forgot-password-email">Email</label>
          <input
            type="email" id="forgot-password-email" placeholder="Email address" required
            [(ngModel)]="forgotPasswordEmail" #forgotPasswordEmailInput
          >
        </div>

        <div class="form-group inputs">
          <span class="action-button action-button-cancel" (click)="hideForgotPasswordModal()">
            Cancel
          </span>

          <input
            type="submit" value="Send me an email to reset my password" class="action-button-submit"
            (click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid"
          >
        </div>
      </div>
    </div>
  </div>
</div>