ActivityPub-federated video streaming platform using P2P directly in your web browser
Add link to register in login form
Chocobozzz2b084d7048a2
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.htmlindex 660a082806..b7fd25d27d 100644--- a/client/src/app/login/login.component.html+++ b/client/src/app/login/login.component.html@@ -7,11 +7,26 @@<form role="form" (ngSubmit)="login()" [formGroup]="form"><div class="form-group">- <label for="username">User</label>- <input- type="text" id="username" placeholder="Username or email address" required- formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"- >+ <div>+ <label for="username">User</label>+ <input+ type="text" id="username" placeholder="Username or email address" required tabindex="1"+ formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }"+ >+ <a *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account">+ or create an account+ </a>++ <a *ngIf="signupAllowed === false" href="https://joinpeertube.org/en/#getting-started" target="_blank" class="create-an-account">+ or create an account on another instance+ </a>++ <my-help+ *ngIf="signupAllowed === false" helpType="custom"+ 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>@@ -21,7 +36,7 @@<label for="password">Password</label><div><input- type="password" name="password" id="password" placeholder="Password" required+ type="password" name="password" id="password" placeholder="Password" required tabindex="2"formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }"><div class="forgot-password-button" (click)="openForgotPasswordModal()">I forgot my password</div>diff --git a/client/src/app/login/login.component.scss b/client/src/app/login/login.component.scssindex 2cf6991cef..4a37ee961b 100644--- a/client/src/app/login/login.component.scss+++ b/client/src/app/login/login.component.scss@@ -1,9 +1,15 @@@import '_variables';@import '_mixins';+label {+ display: block;+}+input:not([type=submit]) {@include peertube-input-text(340px);- display: block;+ display: inline-block;+ margin-right: 5px;+}input[type=submit] {@@ -11,12 +17,13 @@ input[type=submit] {@include orange-button;}-input[type=password] {- display: inline-block;- margin-right: 5px;-}-.forgot-password-button {display: inline-block;cursor: pointer;}++.create-an-account {+ @include disable-default-a-behaviour;++ color: #000;+}diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.tsindex 22e8c77dd4..f7b49ec459 100644--- a/client/src/app/login/login.component.ts+++ b/client/src/app/login/login.component.ts@@ -1,6 +1,7 @@import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'import { FormBuilder, FormGroup, Validators } from '@angular/forms'import { Router } from '@angular/router'+import { RedirectService, ServerService } from '@app/core'import { UserService } from '@app/shared'import { NotificationsService } from 'angular2-notifications'import { ModalDirective } from 'ngx-bootstrap/modal'@@ -34,16 +35,20 @@ export class LoginComponent extends FormReactive implements OnInit {}forgotPasswordEmail = ''- constructor (- private authService: AuthService,- private userService: UserService,- private notificationsService: NotificationsService,- private formBuilder: FormBuilder,- private router: Router- ) {+ constructor (private authService: AuthService,+ private userService: UserService,+ private serverService: ServerService,+ private redirectService: RedirectService,+ private notificationsService: NotificationsService,+ private formBuilder: FormBuilder,+ private router: Router) {super()}+ get signupAllowed () {+ return this.serverService.getConfig().signup.allowed === true+ }+buildForm () {this.form = this.formBuilder.group({username: [ '', Validators.required ],@@ -62,11 +67,12 @@ export class LoginComponent extends FormReactive implements OnInit {const { username, password } = this.form.value- this.authService.login(username, password).subscribe(- () => this.router.navigate(['/videos/list']),+ this.authService.login(username, password)+ .subscribe(+ () => this.redirectService.redirectToHomepage(),- err => this.error = err.message- )+ err => this.error = err.message+ )}askResetPassword () {diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/misc/help.component.htmlindex bacbe9cdbb..e37d93b621 100644--- a/client/src/app/shared/misc/help.component.html+++ b/client/src/app/shared/misc/help.component.html@@ -12,7 +12,7 @@</ng-template></ng-template>-<button+<spanclass="help-tooltip-button" containerClass="help-tooltip" title="Click to get help"#tooltipDirective="bs-tooltip" [tooltip]="tooltipTemplate" triggers="click"-></button>+></span>