From bd898dd76babf6ab33a0040297bfb40a69a69dda Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Oct 2021 11:16:36 +0200 Subject: Add message if registration is disabled --- .../app/+signup/+register/register.component.html | 102 +++++++++++---------- .../app/+signup/+register/register.component.scss | 4 + .../app/+signup/+register/register.component.ts | 7 ++ 3 files changed, 65 insertions(+), 48 deletions(-) diff --git a/client/src/app/+signup/+register/register.component.html b/client/src/app/+signup/+register/register.component.html index de72065d3..b51f08a4c 100644 --- a/client/src/app/+signup/+register/register.component.html +++ b/client/src/app/+signup/+register/register.component.html @@ -1,56 +1,62 @@
-
- Create an account + - -
{{ info }}
- -
-
- - -
- -
- - - - -
- - - - - - - - - - - - - - - - -
- - -
PeerTube is creating your account...
-
+ +
+ Create an account +
-
{{ error }}
-
-
+ +
{{ info }}
+ +
+
+ + +
+ +
+ + + + +
+ + + + + + + + + + + + + + + + +
+ + +
PeerTube is creating your account...
+
+ +
{{ error }}
+
+
+
-
+
diff --git a/client/src/app/+signup/+register/register.component.scss b/client/src/app/+signup/+register/register.component.scss index fc7ddb0e9..e3ef95609 100644 --- a/client/src/app/+signup/+register/register.component.scss +++ b/client/src/app/+signup/+register/register.component.scss @@ -6,6 +6,10 @@ text-align: center; } +.signup-disabled { + padding-top: 30vh; +} + .wrapper { display: flex; flex-direction: column; diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts index d8ac39c7c..bb7276459 100644 --- a/client/src/app/+signup/+register/register.component.ts +++ b/client/src/app/+signup/+register/register.component.ts @@ -42,6 +42,8 @@ export class RegisterComponent implements OnInit { defaultNextStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Next` stepUserButtonLabel = this.defaultNextStepButtonLabel + signupDisabled = false + private serverConfig: ServerConfig constructor ( @@ -62,6 +64,11 @@ export class RegisterComponent implements OnInit { ngOnInit (): void { this.serverConfig = this.route.snapshot.data.serverConfig + if (this.serverConfig.signup.allowed === false || this.serverConfig.signup.allowedForCurrentIP === false) { + this.signupDisabled = true + return + } + this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0 this.stepUserButtonLabel = this.videoUploadDisabled ? $localize`:Button on the registration form to finalize the account and channel creation:Signup` -- cgit v1.2.3