diff options
Diffstat (limited to 'client/src/app/signup')
-rw-r--r-- | client/src/app/signup/signup.component.html | 22 | ||||
-rw-r--r-- | client/src/app/signup/signup.component.ts | 19 |
2 files changed, 24 insertions, 17 deletions
diff --git a/client/src/app/signup/signup.component.html b/client/src/app/signup/signup.component.html index 5f48786e5..2fe9a4281 100644 --- a/client/src/app/signup/signup.component.html +++ b/client/src/app/signup/signup.component.html | |||
@@ -1,11 +1,11 @@ | |||
1 | <div class="margin-content"> | 1 | <div class="margin-content"> |
2 | 2 | ||
3 | <div class="title-page title-page-single"> | 3 | <div i18n class="title-page title-page-single"> |
4 | Create an account | 4 | Create an account |
5 | </div> | 5 | </div> |
6 | 6 | ||
7 | <div class="initial-user-quota"> | 7 | <div class="initial-user-quota"> |
8 | <span class="initial-user-quota-label">Initial video quota:</span> | 8 | <span i18n class="initial-user-quota-label">Initial video quota:</span> |
9 | 9 | ||
10 | <span *ngIf="initialUserVideoQuota !== -1"> | 10 | <span *ngIf="initialUserVideoQuota !== -1"> |
11 | {{ initialUserVideoQuota | bytes: 0 }} | 11 | {{ initialUserVideoQuota | bytes: 0 }} |
@@ -13,18 +13,18 @@ | |||
13 | <my-help helpType="custom" [customHtml]="quotaHelpIndication"></my-help> | 13 | <my-help helpType="custom" [customHtml]="quotaHelpIndication"></my-help> |
14 | </span> | 14 | </span> |
15 | 15 | ||
16 | <ng-template [ngIf]="initialUserVideoQuota === -1"> | 16 | <ng-container i18n *ngIf="initialUserVideoQuota === -1"> |
17 | Unlimited | 17 | Unlimited |
18 | </ng-template> | 18 | </ng-container> |
19 | </div> | 19 | </div> |
20 | 20 | ||
21 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> | 21 | <div *ngIf="error" class="alert alert-danger">{{ error }}</div> |
22 | 22 | ||
23 | <form role="form" (ngSubmit)="signup()" [formGroup]="form"> | 23 | <form role="form" (ngSubmit)="signup()" [formGroup]="form"> |
24 | <div class="form-group"> | 24 | <div class="form-group"> |
25 | <label for="username">Username</label> | 25 | <label for="username" i18n>Username</label> |
26 | <input | 26 | <input |
27 | type="text" id="username" placeholder="Username" | 27 | type="text" id="username" i18n-placeholder placeholder="Username" |
28 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" | 28 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" |
29 | > | 29 | > |
30 | <div *ngIf="formErrors.username" class="form-error"> | 30 | <div *ngIf="formErrors.username" class="form-error"> |
@@ -33,9 +33,9 @@ | |||
33 | </div> | 33 | </div> |
34 | 34 | ||
35 | <div class="form-group"> | 35 | <div class="form-group"> |
36 | <label for="email">Email</label> | 36 | <label for="email" i18n>Email</label> |
37 | <input | 37 | <input |
38 | type="text" id="email" placeholder="Email" | 38 | type="text" id="email" i18n-placeholder placeholder="Email" |
39 | formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }" | 39 | formControlName="email" [ngClass]="{ 'input-error': formErrors['email'] }" |
40 | > | 40 | > |
41 | <div *ngIf="formErrors.email" class="form-error"> | 41 | <div *ngIf="formErrors.email" class="form-error"> |
@@ -44,9 +44,9 @@ | |||
44 | </div> | 44 | </div> |
45 | 45 | ||
46 | <div class="form-group"> | 46 | <div class="form-group"> |
47 | <label for="password">Password</label> | 47 | <label for="password" i18n>Password</label> |
48 | <input | 48 | <input |
49 | type="password" id="password" placeholder="Password" | 49 | type="password" id="password" i18n-placeholder placeholder="Password" |
50 | formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" | 50 | formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" |
51 | > | 51 | > |
52 | <div *ngIf="formErrors.password" class="form-error"> | 52 | <div *ngIf="formErrors.password" class="form-error"> |
@@ -54,7 +54,7 @@ | |||
54 | </div> | 54 | </div> |
55 | </div> | 55 | </div> |
56 | 56 | ||
57 | <input type="submit" value="Signup" [disabled]="!form.valid"> | 57 | <input type="submit" i18n-value value="Signup" [disabled]="!form.valid"> |
58 | </form> | 58 | </form> |
59 | 59 | ||
60 | </div> | 60 | </div> |
diff --git a/client/src/app/signup/signup.component.ts b/client/src/app/signup/signup.component.ts index 1f3e2e146..4a49ead50 100644 --- a/client/src/app/signup/signup.component.ts +++ b/client/src/app/signup/signup.component.ts | |||
@@ -6,6 +6,8 @@ import { ServerService } from '@app/core/server' | |||
6 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
7 | import { UserCreate } from '../../../../shared' | 7 | import { UserCreate } from '../../../../shared' |
8 | import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' | 8 | import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' |
9 | import { RedirectService } from '@app/core' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | 11 | ||
10 | @Component({ | 12 | @Component({ |
11 | selector: 'my-signup', | 13 | selector: 'my-signup', |
@@ -45,7 +47,9 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
45 | private router: Router, | 47 | private router: Router, |
46 | private notificationsService: NotificationsService, | 48 | private notificationsService: NotificationsService, |
47 | private userService: UserService, | 49 | private userService: UserService, |
48 | private serverService: ServerService | 50 | private redirectService: RedirectService, |
51 | private serverService: ServerService, | ||
52 | private i18n: I18n | ||
49 | ) { | 53 | ) { |
50 | super() | 54 | super() |
51 | } | 55 | } |
@@ -78,8 +82,11 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
78 | 82 | ||
79 | this.userService.signup(userCreate).subscribe( | 83 | this.userService.signup(userCreate).subscribe( |
80 | () => { | 84 | () => { |
81 | this.notificationsService.success('Success', `Registration for ${userCreate.username} complete.`) | 85 | this.notificationsService.success( |
82 | this.router.navigate([ '/videos/list' ]) | 86 | this.i18n('Success'), |
87 | this.i18n('Registration for {{ username }} complete.', { username: userCreate.username}) | ||
88 | ) | ||
89 | this.redirectService.redirectToHomepage() | ||
83 | }, | 90 | }, |
84 | 91 | ||
85 | err => this.error = err.message | 92 | err => this.error = err.message |
@@ -99,9 +106,9 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
99 | const normalSeconds = initialUserVideoQuotaBit / (1.5 * 1000 * 1000) | 106 | const normalSeconds = initialUserVideoQuotaBit / (1.5 * 1000 * 1000) |
100 | 107 | ||
101 | const lines = [ | 108 | const lines = [ |
102 | SignupComponent.getApproximateTime(fullHdSeconds) + ' of full HD videos', | 109 | this.i18n('{{ seconds }} of full HD videos', { seconds: SignupComponent.getApproximateTime(fullHdSeconds) }), |
103 | SignupComponent.getApproximateTime(hdSeconds) + ' of HD videos', | 110 | this.i18n('{{ seconds }} of HD videos', { seconds: SignupComponent.getApproximateTime(hdSeconds) }), |
104 | SignupComponent.getApproximateTime(normalSeconds) + ' of average quality videos' | 111 | this.i18n('{{ seconds }} of average quality videos', { seconds: SignupComponent.getApproximateTime(normalSeconds) }) |
105 | ] | 112 | ] |
106 | 113 | ||
107 | this.quotaHelpIndication = lines.join('<br />') | 114 | this.quotaHelpIndication = lines.join('<br />') |