aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/core/server/server.service.ts3
-rw-r--r--client/src/app/login/login.component.html7
-rw-r--r--client/src/app/login/login.component.ts9
3 files changed, 13 insertions, 6 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index da8bd26db..6eccb8336 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -37,6 +37,9 @@ export class ServerService {
37 css: '' 37 css: ''
38 } 38 }
39 }, 39 },
40 email: {
41 enabled: false
42 },
40 serverVersion: 'Unknown', 43 serverVersion: 'Unknown',
41 signup: { 44 signup: {
42 allowed: false, 45 allowed: false,
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html
index 93dbed525..9b8146624 100644
--- a/client/src/app/login/login.component.html
+++ b/client/src/app/login/login.component.html
@@ -59,7 +59,12 @@
59 </div> 59 </div>
60 60
61 <div class="modal-body"> 61 <div class="modal-body">
62 <div class="form-group"> 62
63 <div *ngIf="isEmailDisabled()" class="alert alert-danger" i18n>
64 We are sorry, you cannot recover you password because your instance administrator did not configure the PeerTube email system.
65 </div>
66
67 <div class="form-group" [hidden]="isEmailDisabled()">
63 <label i18n for="forgot-password-email">Email</label> 68 <label i18n for="forgot-password-email">Email</label>
64 <input 69 <input
65 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required 70 type="email" id="forgot-password-email" i18n-placeholder placeholder="Email address" required
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index 7553e6456..212a8ff1f 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -19,7 +19,6 @@ import { Router } from '@angular/router'
19export class LoginComponent extends FormReactive implements OnInit { 19export class LoginComponent extends FormReactive implements OnInit {
20 @ViewChild('emailInput') input: ElementRef 20 @ViewChild('emailInput') input: ElementRef
21 @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef 21 @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef
22 @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef
23 22
24 error: string = null 23 error: string = null
25 forgotPasswordEmail = '' 24 forgotPasswordEmail = ''
@@ -45,6 +44,10 @@ export class LoginComponent extends FormReactive implements OnInit {
45 return this.serverService.getConfig().signup.allowed === true 44 return this.serverService.getConfig().signup.allowed === true
46 } 45 }
47 46
47 isEmailDisabled () {
48 return this.serverService.getConfig().email.enabled === false
49 }
50
48 ngOnInit () { 51 ngOnInit () {
49 this.buildForm({ 52 this.buildForm({
50 username: this.loginValidatorsService.LOGIN_USERNAME, 53 username: this.loginValidatorsService.LOGIN_USERNAME,
@@ -96,10 +99,6 @@ export class LoginComponent extends FormReactive implements OnInit {
96 ) 99 )
97 } 100 }
98 101
99 onForgotPasswordModalShown () {
100 this.forgotPasswordEmailInput.nativeElement.focus()
101 }
102
103 openForgotPasswordModal () { 102 openForgotPasswordModal () {
104 this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal) 103 this.openedForgotPasswordModal = this.modalService.open(this.forgotPasswordModal)
105 } 104 }