]>
Commit | Line | Data |
---|---|---|
1 | <h1 i18n class="title-page-v2"> | |
2 | <strong class="underline-orange">{{ instanceName }}</strong> | |
3 | > | |
4 | Login | |
5 | </h1> | |
6 | ||
7 | <div class="margin-content"> | |
8 | <div class="alert alert-danger" i18n *ngIf="externalAuthError"> | |
9 | Sorry but there was an issue with the external login process. Please <a routerLink="/about">contact an administrator</a>. | |
10 | </div> | |
11 | ||
12 | <ng-container *ngIf="!externalAuthError && !isAuthenticatedWithExternalAuth"> | |
13 | <div *ngIf="error" class="alert alert-danger"> | |
14 | {{ error }} | |
15 | ||
16 | <span *ngIf="error === 'User email is not verified.'"> | |
17 | <a i18n routerLink="/verify-account/ask-send-email">Request new verification email.</a> | |
18 | </span> | |
19 | </div> | |
20 | ||
21 | <div class="alert pt-alert-primary" role="alert"> | |
22 | <h5 class="alert-heading" i18n> | |
23 | Logging into an account lets you publish content | |
24 | </h5> | |
25 | ||
26 | <p *ngIf="signupAllowed" i18n> | |
27 | 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. | |
28 | 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>. | |
29 | </p> | |
30 | ||
31 | <p *ngIf="!signupAllowed" i18n> | |
32 | 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. | |
33 | 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>. | |
34 | </p> | |
35 | </div> | |
36 | ||
37 | <div class="wrapper"> | |
38 | <div class="login-form-and-externals"> | |
39 | ||
40 | <form myPluginSelector pluginSelectorId="login-form" role="form" (ngSubmit)="login()" [formGroup]="form"> | |
41 | <div class="form-group"> | |
42 | <div> | |
43 | <label i18n for="username">Username or email address</label> | |
44 | <input | |
45 | type="text" id="username" i18n-placeholder placeholder="Example: john@example.com" required tabindex="1" | |
46 | formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" myAutofocus | |
47 | > | |
48 | </div> | |
49 | ||
50 | <div *ngIf="formErrors.username" class="form-error">{{ formErrors.username }}</div> | |
51 | ||
52 | <div *ngIf="hasUsernameUppercase()" i18n class="form-warning"> | |
53 | ⚠️ Most email addresses do not include capital letters. | |
54 | </div> | |
55 | </div> | |
56 | ||
57 | <div class="form-group"> | |
58 | <label i18n for="password">Password</label> | |
59 | ||
60 | <my-input-text formControlName="password" inputId="password" | |
61 | i18n-placeholder placeholder="Password" | |
62 | [ngClass]="{ 'input-error': formErrors['password'] }" | |
63 | autocomplete="current-password" [tabindex]="2"></my-input-text> | |
64 | ||
65 | <div *ngIf="formErrors.password" class="form-error">{{ formErrors.password }}</div> | |
66 | </div> | |
67 | ||
68 | <input type="submit" class="peertube-button orange-button" i18n-value value="Login" [disabled]="!form.valid"> | |
69 | ||
70 | <div class="additional-links"> | |
71 | <a i18n role="button" class="link-orange" (click)="openForgotPasswordModal()" i18n-title title="Click here to reset your password">I forgot my password</a> | |
72 | ||
73 | <ng-container *ngIf="signupAllowed"> | |
74 | <span>·</span> | |
75 | <a i18n routerLink="/signup" class="link-orange">Create an account</a> | |
76 | </ng-container> | |
77 | </div> | |
78 | </form> | |
79 | ||
80 | <div class="external-login-blocks" *ngIf="getExternalLogins().length !== 0"> | |
81 | <div class="block-title" i18n>Or sign in with</div> | |
82 | ||
83 | <div> | |
84 | <a class="external-login-block" *ngFor="let auth of getExternalLogins()" [href]="getAuthHref(auth)" role="button"> | |
85 | {{ auth.authDisplayName }} | |
86 | </a> | |
87 | </div> | |
88 | </div> | |
89 | </div> | |
90 | ||
91 | <div #instanceInformation class="instance-information"> | |
92 | <my-instance-about-accordion | |
93 | [displayInstanceName]="false" | |
94 | (init)="onInstanceAboutAccordionInit($event)" [panels]="instanceInformationPanels" | |
95 | pluginScope="login" pluginHook="filter:login.instance-about-plugin-panels.create.result" | |
96 | ></my-instance-about-accordion> | |
97 | </div> | |
98 | </div> | |
99 | </ng-container> | |
100 | </div> | |
101 | ||
102 | <ng-template #forgotPasswordModal> | |
103 | <div class="modal-header"> | |
104 | <h4 i18n class="modal-title">Forgot your password</h4> | |
105 | ||
106 | <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hideForgotPasswordModal()"></my-global-icon> | |
107 | </div> | |
108 | ||
109 | <div class="modal-body"> | |
110 | ||
111 | <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n> | |
112 | We are sorry, you cannot recover your password because your instance administrator did not configure the PeerTube email system. | |
113 | </div> | |
114 | ||
115 | <div *ngIf="!isEmailDisabled()" class="forgot-password-instructions" i18n> | |
116 | Enter your email address and we will send you a link to reset your password. | |
117 | </div> | |
118 | ||
119 | <div class="form-group" [hidden]="isEmailDisabled()"> | |
120 | <label i18n for="forgot-password-email">Email</label> | |
121 | <input | |
122 | type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required | |
123 | [(ngModel)]="forgotPasswordEmail" #forgotPasswordEmailInput | |
124 | > | |
125 | </div> | |
126 | </div> | |
127 | ||
128 | <div class="modal-footer inputs"> | |
129 | <input | |
130 | type="button" role="button" i18n-value value="Cancel" class="peertube-button grey-button" | |
131 | (click)="hideForgotPasswordModal()" (key.enter)="hideForgotPasswordModal()" | |
132 | > | |
133 | ||
134 | <input | |
135 | type="submit" i18n-value="Password reset button" value="Reset" class="peertube-button orange-button" | |
136 | (click)="askResetPassword()" [disabled]="!forgotPasswordEmailInput.validity.valid" | |
137 | > | |
138 | </div> | |
139 | </ng-template> |