- <div class="form-group">
- <label for="password">Password</label>
- <input type="password" #password class="form-control" id="password" placeholder="Password">
- </div>
+ <div *ngIf="error" class="alert alert-danger">{{ error }}</div>
+
+ <form role="form" (ngSubmit)="login()" [formGroup]="form">
+ <div class="form-group">
+ <div>
+ <label i18n for="username">User</label>
+ <input
+ type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1"
+ formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"
+ >
+ <a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">
+ or create an account
+ </a>
+
+ <a i18n *ngIf="signupAllowed === false" href="https://joinpeertube.org/en/#getting-started" target="_blank" title="Click here to see how to get started!" class="create-an-account">
+ or create an account on another instance
+ </a>
+
+ <my-help
+ *ngIf="signupAllowed === false" helpType="custom" i18n-customHtml
+ 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 i18n for="password">Password</label>
+ <div>
+ <input
+ type="password" name="password" id="password" i18n-placeholder placeholder="Password" required tabindex="2"
+ formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"
+ >
+ <a i18n class="forgot-password-button" (click)="openForgotPasswordModal()" title="Click here to reset your password">I forgot my password</a>
+ </div>
+ <div *ngIf="formErrors.password" class="form-error">
+ {{ formErrors.password }}
+ </div>
+ </div>