diff options
author | Kimsible <1877318+kimsible@users.noreply.github.com> | 2020-12-07 16:34:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 16:34:07 +0100 |
commit | 40360c17d82b33accb34ea974c275e17880c37aa (patch) | |
tree | e0ddac1174e54897b4871daa4dca43dce121f590 /client/src/app/+signup/+register/register-step-terms.component.ts | |
parent | 10f26f4203b8cef32778bf3435d8112eaea3c093 (diff) | |
download | PeerTube-40360c17d82b33accb34ea974c275e17880c37aa.tar.gz PeerTube-40360c17d82b33accb34ea974c275e17880c37aa.tar.zst PeerTube-40360c17d82b33accb34ea974c275e17880c37aa.zip |
improvements to login and sign-up pages (#3357)
* New login form ui
* Move InstanceAboutAccordion to shared components
* Update closed registration alert text
* Add alert for opened registration and move them bellow login form
* Adjust flex block on signup and login views
* Replace toggle accordion with expand on links in signup and login + scrollTo
* Improve display of login alerts
* Fix missing Component suffix
* Define min-width instance-information block sign-up and login for mobile screens
* Add ability to select specific panels in instanceAboutAccorddion
* Add instance title and short-description to common instanceAboutAccordion
* Clarify title alert in login page
* Add step terms for signup
Co-authored-by: kimsible <kimsible@users.noreply.github.com>
Co-authored-by: Rigel Kent <sendmemail@rigelk.eu>
Diffstat (limited to 'client/src/app/+signup/+register/register-step-terms.component.ts')
-rw-r--r-- | client/src/app/+signup/+register/register-step-terms.component.ts | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/client/src/app/+signup/+register/register-step-terms.component.ts b/client/src/app/+signup/+register/register-step-terms.component.ts new file mode 100644 index 000000000..db834c68d --- /dev/null +++ b/client/src/app/+signup/+register/register-step-terms.component.ts | |||
@@ -0,0 +1,47 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | ||
2 | import { FormGroup } from '@angular/forms' | ||
3 | import { | ||
4 | USER_TERMS_VALIDATOR | ||
5 | } from '@app/shared/form-validators/user-validators' | ||
6 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | ||
7 | |||
8 | @Component({ | ||
9 | selector: 'my-register-step-terms', | ||
10 | templateUrl: './register-step-terms.component.html', | ||
11 | styleUrls: [ './register.component.scss' ] | ||
12 | }) | ||
13 | export class RegisterStepTermsComponent extends FormReactive implements OnInit { | ||
14 | @Input() hasCodeOfConduct = false | ||
15 | |||
16 | @Output() formBuilt = new EventEmitter<FormGroup>() | ||
17 | @Output() termsClick = new EventEmitter<void>() | ||
18 | @Output() codeOfConductClick = new EventEmitter<void>() | ||
19 | |||
20 | constructor ( | ||
21 | protected formValidatorService: FormValidatorService | ||
22 | ) { | ||
23 | super() | ||
24 | } | ||
25 | |||
26 | get instanceHost () { | ||
27 | return window.location.host | ||
28 | } | ||
29 | |||
30 | ngOnInit () { | ||
31 | this.buildForm({ | ||
32 | terms: USER_TERMS_VALIDATOR | ||
33 | }) | ||
34 | |||
35 | setTimeout(() => this.formBuilt.emit(this.form)) | ||
36 | } | ||
37 | |||
38 | onTermsClick (event: Event) { | ||
39 | event.preventDefault() | ||
40 | this.termsClick.emit() | ||
41 | } | ||
42 | |||
43 | onCodeOfConductClick (event: Event) { | ||
44 | event.preventDefault() | ||
45 | this.codeOfConductClick.emit() | ||
46 | } | ||
47 | } | ||