Create an account
</div>
+ <div *ngIf="info" class="alert alert-info">{{ info }}</div>
<div *ngIf="error" class="alert alert-danger">{{ error }}</div>
<div class="d-flex justify-content-left flex-wrap">
</div>
</div>
- <input type="submit" i18n-value value="Signup" [disabled]="!form.valid">
+ <input type="submit" i18n-value value="Signup" [disabled]="!form.valid || signupDone">
</form>
<div>
styleUrls: [ './signup.component.scss' ]
})
export class SignupComponent extends FormReactive implements OnInit {
+ info: string = null
error: string = null
+ signupDone = false
constructor (
protected formValidatorService: FormValidatorService,
this.userService.signup(userCreate).subscribe(
() => {
+ this.signupDone = true
+
if (this.requiresEmailVerification) {
- this.notificationsService.alert(
- this.i18n('Welcome'),
- this.i18n('Please check your email to verify your account and complete signup.')
- )
- } else {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Registration for {{username}} complete.', { username: userCreate.username })
- )
+ this.info = this.i18n('Welcome! Now please check your emails to verify your account and complete signup.')
+ return
}
+
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Registration for {{username}} complete.', { username: userCreate.username })
+ )
this.redirectService.redirectToHomepage()
},