1 | <h1 id="title" class="title">Login</h1>
|
2 | <p class="sub-title">Hello! Log in with your email.</p>
|
3 |
|
4 | <nb-alert *ngIf="showMessages.error && errors?.length && !submitted" outline="danger" role="alert">
|
5 | <p class="alert-title"><b>Oh snap!</b></p>
|
6 | <ul class="alert-message-list">
|
7 | <li *ngFor="let error of errors" class="alert-message">{{ error }}</li>
|
8 | </ul>
|
9 | </nb-alert>
|
10 |
|
11 | <nb-alert *ngIf="showMessages.success && messages?.length && !submitted" outline="success" role="alert">
|
12 | <p class="alert-title"><b>Hooray!</b></p>
|
13 | <ul class="alert-message-list">
|
14 | <li *ngFor="let message of messages" class="alert-message">{{ message }}</li>
|
15 | </ul>
|
16 | </nb-alert>
|
17 |
|
18 | <form (ngSubmit)="login()" #form="ngForm" aria-labelledby="title">
|
19 |
|
20 | <div class="form-control-group">
|
21 | <label class="label" for="input-email">Email address:</label>
|
22 | <input nbInput
|
23 | fullWidth
|
24 | [(ngModel)]="user.email"
|
25 | #email="ngModel"
|
26 | name="email"
|
27 | id="input-email"
|
28 | pattern=".+@.+\..+"
|
29 | placeholder="Email address"
|
30 | fieldSize="large"
|
31 | autofocus
|
32 | [status]="email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'"
|
33 | [required]="getConfigValue('forms.validation.email.required')"
|
34 | [attr.aria-invalid]="email.invalid && email.touched ? true : null">
|
35 | <ng-container *ngIf="email.invalid && email.touched">
|
36 | <p class="caption status-danger" *ngIf="email.errors?.required">
|
37 | Email is required!
|
38 | </p>
|
39 | <p class="caption status-danger" *ngIf="email.errors?.pattern">
|
40 | Email should be the real one!
|
41 | </p>
|
42 | </ng-container>
|
43 | </div>
|
44 |
|
45 | <div class="form-control-group">
|
46 | <span class="label-with-link">
|
47 | <label class="label" for="input-password">Password:</label>
|
48 | <a class="forgot-password caption-2" routerLink="../request-password">Forgot Password?</a>
|
49 | </span>
|
50 | <input nbInput
|
51 | fullWidth
|
52 | [(ngModel)]="user.password"
|
53 | #password="ngModel"
|
54 | name="password"
|
55 | type="password"
|
56 | id="input-password"
|
57 | placeholder="Password"
|
58 | fieldSize="large"
|
59 | [status]="password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'"
|
60 | [required]="getConfigValue('forms.validation.password.required')"
|
61 | [minlength]="getConfigValue('forms.validation.password.minLength')"
|
62 | [maxlength]="getConfigValue('forms.validation.password.maxLength')"
|
63 | [attr.aria-invalid]="password.invalid && password.touched ? true : null">
|
64 | <ng-container *ngIf="password.invalid && password.touched ">
|
65 | <p class="caption status-danger" *ngIf="password.errors?.required">
|
66 | Password is required!
|
67 | </p>
|
68 | <p class="caption status-danger" *ngIf="password.errors?.minlength || password.errors?.maxlength">
|
69 | Password should contain
|
70 | from {{ getConfigValue('forms.validation.password.minLength') }}
|
71 | to {{ getConfigValue('forms.validation.password.maxLength') }}
|
72 | characters
|
73 | </p>
|
74 | </ng-container>
|
75 | </div>
|
76 |
|
77 | <div class="form-control-group accept-group">
|
78 | <nb-checkbox name="rememberMe" [(ngModel)]="user.rememberMe" *ngIf="rememberMe">Remember me</nb-checkbox>
|
79 | </div>
|
80 |
|
81 | <button nbButton
|
82 | fullWidth
|
83 | status="primary"
|
84 | size="large"
|
85 | [disabled]="submitted || !form.valid"
|
86 | [class.btn-pulse]="submitted">
|
87 | Log In
|
88 | </button>
|
89 | </form>
|
90 |
|
91 | <section *ngIf="socialLinks && socialLinks.length > 0" class="links" aria-label="Social sign in">
|
92 | or enter with:
|
93 | <div class="socials">
|
94 | <ng-container *ngFor="let socialLink of socialLinks">
|
95 | <a *ngIf="socialLink.link"
|
96 | [routerLink]="socialLink.link"
|
97 | [attr.target]="socialLink.target"
|
98 | [attr.class]="socialLink.icon"
|
99 | [class.with-icon]="socialLink.icon">
|
100 | <nb-icon *ngIf="socialLink.icon; else title" [icon]="socialLink.icon"></nb-icon>
|
101 | <ng-template #title>{{ socialLink.title }}</ng-template>
|
102 | </a>
|
103 | <a *ngIf="socialLink.url"
|
104 | [attr.href]="socialLink.url"
|
105 | [attr.target]="socialLink.target"
|
106 | [attr.class]="socialLink.icon"
|
107 | [class.with-icon]="socialLink.icon">
|
108 | <nb-icon *ngIf="socialLink.icon; else title" [icon]="socialLink.icon"></nb-icon>
|
109 | <ng-template #title>{{ socialLink.title }}</ng-template>
|
110 | </a>
|
111 | </ng-container>
|
112 | </div>
|
113 | </section>
|
114 |
|
115 | <section class="another-action" aria-label="Register">
|
116 | Don't have an account? <a class="text-link" routerLink="../register">Register</a>
|
117 | </section>
|