diff options
Diffstat (limited to 'client/src/app/+signup/+register/steps')
6 files changed, 32 insertions, 9 deletions
diff --git a/client/src/app/+signup/+register/steps/register-step-about.component.html b/client/src/app/+signup/+register/steps/register-step-about.component.html index 769fe3127..580e8a92c 100644 --- a/client/src/app/+signup/+register/steps/register-step-about.component.html +++ b/client/src/app/+signup/+register/steps/register-step-about.component.html | |||
@@ -13,6 +13,10 @@ | |||
13 | <li i18n>Have access to your <strong>watch history</strong></li> | 13 | <li i18n>Have access to your <strong>watch history</strong></li> |
14 | <li *ngIf="!videoUploadDisabled" i18n>Create your channel to <strong>publish videos</strong></li> | 14 | <li *ngIf="!videoUploadDisabled" i18n>Create your channel to <strong>publish videos</strong></li> |
15 | </ul> | 15 | </ul> |
16 | |||
17 | <p *ngIf="requiresApproval" i18n> | ||
18 | Moderators of {{ instanceName }} will have to approve your registration request once you have finished to fill the form. | ||
19 | </p> | ||
16 | </div> | 20 | </div> |
17 | 21 | ||
18 | <div> | 22 | <div> |
diff --git a/client/src/app/+signup/+register/steps/register-step-about.component.ts b/client/src/app/+signup/+register/steps/register-step-about.component.ts index 9a0941016..b176ffa59 100644 --- a/client/src/app/+signup/+register/steps/register-step-about.component.ts +++ b/client/src/app/+signup/+register/steps/register-step-about.component.ts | |||
@@ -7,6 +7,7 @@ import { ServerService } from '@app/core' | |||
7 | styleUrls: [ './register-step-about.component.scss' ] | 7 | styleUrls: [ './register-step-about.component.scss' ] |
8 | }) | 8 | }) |
9 | export class RegisterStepAboutComponent { | 9 | export class RegisterStepAboutComponent { |
10 | @Input() requiresApproval: boolean | ||
10 | @Input() videoUploadDisabled: boolean | 11 | @Input() videoUploadDisabled: boolean |
11 | 12 | ||
12 | constructor (private serverService: ServerService) { | 13 | constructor (private serverService: ServerService) { |
diff --git a/client/src/app/+signup/+register/steps/register-step-channel.component.ts b/client/src/app/+signup/+register/steps/register-step-channel.component.ts index df92c5145..478ca0177 100644 --- a/client/src/app/+signup/+register/steps/register-step-channel.component.ts +++ b/client/src/app/+signup/+register/steps/register-step-channel.component.ts | |||
@@ -2,9 +2,9 @@ import { concat, of } from 'rxjs' | |||
2 | import { pairwise } from 'rxjs/operators' | 2 | import { pairwise } from 'rxjs/operators' |
3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { SignupService } from '@app/+signup/shared/signup.service' | ||
5 | import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' | 6 | import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' |
6 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 7 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
7 | import { UserSignupService } from '@app/shared/shared-users' | ||
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-register-step-channel', | 10 | selector: 'my-register-step-channel', |
@@ -20,7 +20,7 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit | |||
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
22 | protected formReactiveService: FormReactiveService, | 22 | protected formReactiveService: FormReactiveService, |
23 | private userSignupService: UserSignupService | 23 | private signupService: SignupService |
24 | ) { | 24 | ) { |
25 | super() | 25 | super() |
26 | } | 26 | } |
@@ -51,7 +51,7 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit | |||
51 | private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { | 51 | private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { |
52 | const name = this.form.value['name'] || '' | 52 | const name = this.form.value['name'] || '' |
53 | 53 | ||
54 | const newName = this.userSignupService.getNewUsername(oldDisplayName, newDisplayName, name) | 54 | const newName = this.signupService.getNewUsername(oldDisplayName, newDisplayName, name) |
55 | this.form.patchValue({ name: newName }) | 55 | this.form.patchValue({ name: newName }) |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/client/src/app/+signup/+register/steps/register-step-terms.component.html b/client/src/app/+signup/+register/steps/register-step-terms.component.html index cbfb32518..1d753a3f2 100644 --- a/client/src/app/+signup/+register/steps/register-step-terms.component.html +++ b/client/src/app/+signup/+register/steps/register-step-terms.component.html | |||
@@ -1,4 +1,16 @@ | |||
1 | <form role="form" [formGroup]="form"> | 1 | <form role="form" [formGroup]="form"> |
2 | |||
3 | <div *ngIf="requiresApproval" class="form-group"> | ||
4 | <label i18n for="registrationReason">Why do you want to join {{ instanceName }}?</label> | ||
5 | |||
6 | <textarea | ||
7 | id="registrationReason" formControlName="registrationReason" class="form-control" rows="4" | ||
8 | [ngClass]="{ 'input-error': formErrors['registrationReason'] }" | ||
9 | ></textarea> | ||
10 | |||
11 | <div *ngIf="formErrors.registrationReason" class="form-error">{{ formErrors.registrationReason }}</div> | ||
12 | </div> | ||
13 | |||
2 | <div class="form-group"> | 14 | <div class="form-group"> |
3 | <my-peertube-checkbox inputName="terms" formControlName="terms"> | 15 | <my-peertube-checkbox inputName="terms" formControlName="terms"> |
4 | <ng-template ptTemplate="label"> | 16 | <ng-template ptTemplate="label"> |
@@ -6,7 +18,7 @@ | |||
6 | I am at least {{ minimumAge }} years old and agree | 18 | I am at least {{ minimumAge }} years old and agree |
7 | to the <a class="link-orange" (click)="onTermsClick($event)" href='#'>Terms</a> | 19 | to the <a class="link-orange" (click)="onTermsClick($event)" href='#'>Terms</a> |
8 | <ng-container *ngIf="hasCodeOfConduct"> and to the <a class="link-orange" (click)="onCodeOfConductClick($event)" href='#'>Code of Conduct</a></ng-container> | 20 | <ng-container *ngIf="hasCodeOfConduct"> and to the <a class="link-orange" (click)="onCodeOfConductClick($event)" href='#'>Code of Conduct</a></ng-container> |
9 | of this instance | 21 | of {{ instanceName }} |
10 | </ng-container> | 22 | </ng-container> |
11 | </ng-template> | 23 | </ng-template> |
12 | </my-peertube-checkbox> | 24 | </my-peertube-checkbox> |
diff --git a/client/src/app/+signup/+register/steps/register-step-terms.component.ts b/client/src/app/+signup/+register/steps/register-step-terms.component.ts index 2df963b30..1b1fb49ee 100644 --- a/client/src/app/+signup/+register/steps/register-step-terms.component.ts +++ b/client/src/app/+signup/+register/steps/register-step-terms.component.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { FormGroup } from '@angular/forms' | 2 | import { FormGroup } from '@angular/forms' |
3 | import { USER_TERMS_VALIDATOR } from '@app/shared/form-validators/user-validators' | ||
4 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 3 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
4 | import { REGISTER_REASON_VALIDATOR, REGISTER_TERMS_VALIDATOR } from '../shared' | ||
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'my-register-step-terms', | 7 | selector: 'my-register-step-terms', |
@@ -10,7 +10,9 @@ import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | |||
10 | }) | 10 | }) |
11 | export class RegisterStepTermsComponent extends FormReactive implements OnInit { | 11 | export class RegisterStepTermsComponent extends FormReactive implements OnInit { |
12 | @Input() hasCodeOfConduct = false | 12 | @Input() hasCodeOfConduct = false |
13 | @Input() requiresApproval: boolean | ||
13 | @Input() minimumAge = 16 | 14 | @Input() minimumAge = 16 |
15 | @Input() instanceName: string | ||
14 | 16 | ||
15 | @Output() formBuilt = new EventEmitter<FormGroup>() | 17 | @Output() formBuilt = new EventEmitter<FormGroup>() |
16 | @Output() termsClick = new EventEmitter<void>() | 18 | @Output() termsClick = new EventEmitter<void>() |
@@ -28,7 +30,11 @@ export class RegisterStepTermsComponent extends FormReactive implements OnInit { | |||
28 | 30 | ||
29 | ngOnInit () { | 31 | ngOnInit () { |
30 | this.buildForm({ | 32 | this.buildForm({ |
31 | terms: USER_TERMS_VALIDATOR | 33 | terms: REGISTER_TERMS_VALIDATOR, |
34 | |||
35 | registrationReason: this.requiresApproval | ||
36 | ? REGISTER_REASON_VALIDATOR | ||
37 | : null | ||
32 | }) | 38 | }) |
33 | 39 | ||
34 | setTimeout(() => this.formBuilt.emit(this.form)) | 40 | setTimeout(() => this.formBuilt.emit(this.form)) |
diff --git a/client/src/app/+signup/+register/steps/register-step-user.component.ts b/client/src/app/+signup/+register/steps/register-step-user.component.ts index 822f8f5c5..0a5d2e437 100644 --- a/client/src/app/+signup/+register/steps/register-step-user.component.ts +++ b/client/src/app/+signup/+register/steps/register-step-user.component.ts | |||
@@ -2,6 +2,7 @@ import { concat, of } from 'rxjs' | |||
2 | import { pairwise } from 'rxjs/operators' | 2 | import { pairwise } from 'rxjs/operators' |
3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { SignupService } from '@app/+signup/shared/signup.service' | ||
5 | import { | 6 | import { |
6 | USER_DISPLAY_NAME_REQUIRED_VALIDATOR, | 7 | USER_DISPLAY_NAME_REQUIRED_VALIDATOR, |
7 | USER_EMAIL_VALIDATOR, | 8 | USER_EMAIL_VALIDATOR, |
@@ -9,7 +10,6 @@ import { | |||
9 | USER_USERNAME_VALIDATOR | 10 | USER_USERNAME_VALIDATOR |
10 | } from '@app/shared/form-validators/user-validators' | 11 | } from '@app/shared/form-validators/user-validators' |
11 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' | 12 | import { FormReactive, FormReactiveService } from '@app/shared/shared-forms' |
12 | import { UserSignupService } from '@app/shared/shared-users' | ||
13 | 13 | ||
14 | @Component({ | 14 | @Component({ |
15 | selector: 'my-register-step-user', | 15 | selector: 'my-register-step-user', |
@@ -24,7 +24,7 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit { | |||
24 | 24 | ||
25 | constructor ( | 25 | constructor ( |
26 | protected formReactiveService: FormReactiveService, | 26 | protected formReactiveService: FormReactiveService, |
27 | private userSignupService: UserSignupService | 27 | private signupService: SignupService |
28 | ) { | 28 | ) { |
29 | super() | 29 | super() |
30 | } | 30 | } |
@@ -57,7 +57,7 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit { | |||
57 | private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { | 57 | private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { |
58 | const username = this.form.value['username'] || '' | 58 | const username = this.form.value['username'] || '' |
59 | 59 | ||
60 | const newUsername = this.userSignupService.getNewUsername(oldDisplayName, newDisplayName, username) | 60 | const newUsername = this.signupService.getNewUsername(oldDisplayName, newDisplayName, username) |
61 | this.form.patchValue({ username: newUsername }) | 61 | this.form.patchValue({ username: newUsername }) |
62 | } | 62 | } |
63 | } | 63 | } |