]>
Commit | Line | Data |
---|---|---|
1 | <div class="margin-content"> | |
2 | <div i18n class="title-page title-page-single"> | |
3 | Login | |
4 | </div> | |
5 | ||
6 | <div class="alert alert-danger" i18n *ngIf="externalAuthError"> | |
7 | Sorry but there was an issue with the external login process. Please <a routerLink="/about">contact an administrator</a>. | |
8 | </div> | |
9 | ||
10 | <ng-container *ngIf="!externalAuthError && !isAuthenticatedWithExternalAuth"> | |
11 | <div *ngIf="error" class="alert alert-danger">{{ error }} | |
12 | <span *ngIf="error === 'User email is not verified.'"> <a i18n routerLink="/verify-account/ask-send-email">Request new verification email.</a></span> | |
13 | </div> | |
14 | ||
15 | <div class="wrapper"> | |
16 | <div class="login-form-and-externals"> | |
17 | ||
18 | <form role="form" (ngSubmit)="login()" [formGroup]="form"> | |
19 | <div class="form-group"> | |
20 | <div> | |
21 | <label i18n for="username">User</label> | |
22 | <input | |
23 | type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1" | |
24 | formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" #usernameInput | |
25 | > | |
26 | </div> | |
27 | ||
28 | <div *ngIf="formErrors.username" class="form-error"> | |
29 | {{ formErrors.username }} | |
30 | </div> | |
31 | </div> | |
32 | ||
33 | <div class="form-group"> | |
34 | <label i18n for="password">Password</label> | |
35 | <my-input-toggle-hidden formControlName="password" id="password" | |
36 | i18n-placeholder placeholder="Password" | |
37 | [ngClass]="{ 'input-error': formErrors['password'] }" | |
38 | autocomplete="current-password" tabindex="2"></my-input-toggle-hidden> | |
39 | <div *ngIf="formErrors.password" class="form-error"> | |
40 | {{ formErrors.password }} | |
41 | </div> | |
42 | </div> | |
43 | ||
44 | <input type="submit" i18n-value value="Login" [disabled]="!form.valid"> | |
45 | ||
46 | <div class="additionnal-links"> | |
47 | <a class="forgot-password-button" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">I forgot my password</a> | |
48 | <div *ngIf="signupAllowed" class="signup-link"> | |
49 | <span>ยท</span> | |
50 | <a i18n routerLink="/signup" class="create-an-account">Create an account</a> | |
51 | </div> | |
52 | </div> | |
53 | ||
54 | <div class="looking-for-account alert alert-info" role="alert"> | |
55 | <h6 class="alert-heading" i18n> | |
56 | Logging into an account lets you publish content | |
57 | </h6> | |
58 | ||
59 | <div *ngIf="signupAllowed" i18n> | |
60 | This instance allows registration. However, be careful to check the <a class="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. | |
61 | You may also search for another instance to match your exact needs at: <br /><a class="alert-link" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>. | |
62 | </div> | |
63 | ||
64 | <div *ngIf="!signupAllowed" i18n> | |
65 | 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. | |
66 | Find yours among multiple instances at: <br /> <a class="alert-link" href="https://joinpeertube.org/instances" target="_blank" rel="noopener noreferrer">https://joinpeertube.org/instances</a>. | |
67 | </div> | |
68 | </div> | |
69 | </form> | |
70 | ||
71 | <div class="external-login-blocks" *ngIf="getExternalLogins().length !== 0"> | |
72 | <div class="block-title" i18n>Or sign in with</div> | |
73 | ||
74 | <div> | |
75 | <a class="external-login-block" *ngFor="let auth of getExternalLogins()" [href]="getAuthHref(auth)" role="button"> | |
76 | {{ auth.authDisplayName }} | |
77 | </a> | |
78 | </div> | |
79 | </div> | |
80 | </div> | |
81 | ||
82 | <div #instanceInformation class="instance-information"> | |
83 | <my-instance-about-accordion (init)="onInstanceAboutAccordionInit($event)" [panels]="instanceInformationPanels"></my-instance-about-accordion> | |
84 | </div> | |
85 | </div> | |
86 | </ng-container> | |
87 | </div> | |
88 | ||
89 | <ng-template #forgotPasswordModal> | |
90 | <div class="modal-header"> | |
91 | <h4 i18n class="modal-title">Forgot your password</h4> | |
92 | ||
93 | <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideForgotPasswordModal()"></my-global-icon> | |
94 | </div> | |
95 | ||
96 | <div class="modal-body"> | |
97 | ||
98 | <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n> | |
99 | We are sorry, you cannot recover your password because your instance administrator did not configure the PeerTube email system. | |
100 | </div> | |
101 | ||
102 | <div *ngIf="!isEmailDisabled()" class="forgot-password-instructions" i18n> | |
103 | Enter your email address and we will send you a link to reset your password. | |
104 | </div> | |
105 | ||
106 | <div class="form-group" [hidden]="isEmailDisabled()"> | |
107 | <label i18n for="forgot-password-email">Email</label> | |
108 | <input | |
109 | type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required | |
110 | [(ngModel)]="forgotPasswordEmail" #forgotPasswordEmailInput | |
111 | > | |
112 | </div> | |
113 | </div> | |
114 | ||
115 | <div class="modal-footer inputs"> | |
116 | <input | |
117 | type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel" | |
118 | (click)="hideForgotPasswordModal()" (key.enter)="hideForgotPasswordModal()" | |
119 | > | |
120 | ||
121 | <input | |
122 | type="submit" i18n-value="Password reset button" value="Reset" class="action-button-submit" | |
123 | (click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid" | |
124 | > | |
125 | </div> | |
126 | </ng-template> |