diff --git a/client/src/app/+signup/+register/register.component.scss b/client/src/app/+signup/+register/register.component.scss
index 53093a81a..5d0df81bd 100644
--- a/client/src/app/+signup/+register/register.component.scss
+++ b/client/src/app/+signup/+register/register.component.scss
@@ -2,7 +2,7 @@
@use '_mixins' as *;
.alert {
- font-size: 15px;
+ font-size: 16px;
text-align: center;
}
@@ -10,61 +10,75 @@
padding-top: 30vh;
}
-.wrapper {
- display: flex;
- flex-direction: column;
-
- .register-form {
- max-width: 600px;
- align-self: center;
- }
-
- .register-form,
- .instance-information {
- width: 100%;
- }
-
- .instance-information {
- margin-bottom: 15px;
- }
+.header-title {
+ font-weight: normal;
+ font-size: 15px;
+ background-color: pvar(--mainColorVeryLight);
+ padding: 35px 25px 15px 25px;
+ margin: 0;
}
-input:not([type=submit]) {
- @include peertube-input-text(100%);
+.register-content {
+ font-size: 16px;
+}
+
+my-instance-about-accordion {
display: block;
+ margin-bottom: 25px;
+}
- username,
- name {
- width: auto !important;
- flex-grow: 1;
+.step-buttons {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+
+ .skip-step {
+ @include margin-right(30px);
+
+ display: inline-block;
+ }
+
+ .skip-step-description {
+ margin-top: 5px;
+ font-size: 14px;
+ }
+
+ .underline-orange {
+ color: pvar(--mainForegroundColor);
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+
+ button,
+ .skip-step {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ }
+
+ .skip-step,
+ button[cdkStepperNext] {
+ @include margin-left(auto);
+ }
+
+ .skip-step + button[cdkStepperNext] {
+ @include margin-left(0);
}
}
-input[type=submit],
button {
- @include peertube-button;
+ @include peertube-button-big;
&[cdkStepperNext] {
@include orange-button;
-
- // Chrome does not support inline-end
- float: right;
- float: inline-end;
}
&[cdkStepperPrevious] {
@include grey-button;
-
- // Chrome does not support inline-start
- float: left;
- float: inline-start;
}
}
-.name-information {
- margin-top: 10px;
-}
-
.done-loader {
display: flex;
justify-content: center;
@@ -73,13 +87,16 @@ button {
my-loader {
margin-bottom: 20px;
+ }
+}
- ::ng-deep .loader div {
- border-color: pvar(--mainColor) transparent transparent transparent;
- }
+@media screen and (max-width: $small-view) {
+ .step-buttons {
+ justify-content: space-between;
- + div {
- font-size: 15px;
+ .skip-step,
+ button[cdkStepperNext] {
+ @include margin-left(0);
}
}
}
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index b4a7c0d0e..396b27e5a 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -1,4 +1,5 @@
-import { Component, OnInit } from '@angular/core'
+import { CdkStep } from '@angular/cdk/stepper'
+import { Component, OnInit, ViewChild } from '@angular/core'
import { FormGroup } from '@angular/forms'
import { ActivatedRoute } from '@angular/router'
import { AuthService } from '@app/core'
@@ -15,13 +16,15 @@ import { ServerConfig } from '@shared/models/server'
styleUrls: [ './register.component.scss' ]
})
export class RegisterComponent implements OnInit {
+ @ViewChild('lastStep') lastStep: CdkStep
+
accordion: NgbAccordion
- info: string = null
- error: string = null
- success: string = null
- signupDone = false
+
+ signupError: string
+ signupSuccess = false
videoUploadDisabled: boolean
+ videoQuota: number
formStepTerms: FormGroup
formStepUser: FormGroup
@@ -39,8 +42,8 @@ export class RegisterComponent implements OnInit {
moderation: false
}
- defaultPreviousStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Back`
- defaultNextStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Next`
+ defaultPreviousStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Go to the previous step`
+ defaultNextStepButtonLabel = $localize`:Button on the registration form to go to the previous step:Go to the next step`
stepUserButtonLabel = this.defaultNextStepButtonLabel
signupDisabled = false
@@ -62,7 +65,11 @@ export class RegisterComponent implements OnInit {
return this.serverConfig.signup.minimumAge
}
- ngOnInit (): void {
+ get instanceName () {
+ return this.serverConfig.instance.name
+ }
+
+ ngOnInit () {
this.serverConfig = this.route.snapshot.data.serverConfig
if (this.serverConfig.signup.allowed === false || this.serverConfig.signup.allowedForCurrentIP === false) {
@@ -70,7 +77,9 @@ export class RegisterComponent implements OnInit {
return
}
- this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
+ this.videoQuota = this.serverConfig.user.videoQuota
+ this.videoUploadDisabled = this.videoQuota === 0
+
this.stepUserButtonLabel = this.videoUploadDisabled
? $localize`:Button on the registration form to finalize the account and channel creation:Signup`
: this.defaultNextStepButtonLabel
@@ -120,21 +129,31 @@ export class RegisterComponent implements OnInit {
this.aboutHtml = instanceAboutAccordion.aboutHtml
}
+ skipChannelCreation () {
+ this.formStepChannel.reset()
+ this.lastStep.select()
+ this.signup()
+ }
+
async signup () {
- this.error = null
+ this.signupError = undefined
const body: UserRegister = await this.hooks.wrapObject(
- Object.assign(this.formStepUser.value, { channel: this.videoUploadDisabled ? undefined : this.formStepChannel.value }),
+ {
+ ...this.formStepUser.value,
+
+ channel: this.formStepChannel?.value?.name
+ ? this.formStepChannel.value
+ : undefined
+ },
'signup',
'filter:api.signup.registration.create.params'
)
this.userSignupService.signup(body).subscribe({
next: () => {
- this.signupDone = true
-
if (this.requiresEmailVerification) {
- this.info = $localize`Now please check your emails to verify your account and complete signup.`
+ this.signupSuccess = true
return
}
@@ -142,17 +161,17 @@ export class RegisterComponent implements OnInit {
this.authService.login(body.username, body.password)
.subscribe({
next: () => {
- this.success = $localize`You are now logged in as ${body.username}!`
+ this.signupSuccess = true
},
error: err => {
- this.error = err.message
+ this.signupError = err.message
}
})
},
error: err => {
- this.error = err.message
+ this.signupError = err.message
}
})
}
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts
index 52cdb33bc..684aae2e9 100644
--- a/client/src/app/+signup/+register/register.module.ts
+++ b/client/src/app/+signup/+register/register.module.ts
@@ -2,15 +2,15 @@ import { CdkStepperModule } from '@angular/cdk/stepper'
import { NgModule } from '@angular/core'
import { SharedSignupModule } from '@app/+signup/shared/shared-signup.module'
import { SharedInstanceModule } from '@app/shared/shared-instance'
+import { SharedMainModule } from '@app/shared/shared-main'
import { CustomStepperComponent } from './custom-stepper.component'
import { RegisterRoutingModule } from './register-routing.module'
-import { RegisterStepChannelComponent } from './register-step-channel.component'
-import { RegisterStepTermsComponent } from './register-step-terms.component'
-import { RegisterStepUserComponent } from './register-step-user.component'
import { RegisterComponent } from './register.component'
+import { RegisterStepAboutComponent, RegisterStepChannelComponent, RegisterStepTermsComponent, RegisterStepUserComponent } from './steps'
@NgModule({
imports: [
+ SharedMainModule,
RegisterRoutingModule,
CdkStepperModule,
@@ -25,7 +25,8 @@ import { RegisterComponent } from './register.component'
CustomStepperComponent,
RegisterStepChannelComponent,
RegisterStepTermsComponent,
- RegisterStepUserComponent
+ RegisterStepUserComponent,
+ RegisterStepAboutComponent
],
exports: [
diff --git a/client/src/app/+signup/+register/steps/index.ts b/client/src/app/+signup/+register/steps/index.ts
new file mode 100644
index 000000000..b5eae7468
--- /dev/null
+++ b/client/src/app/+signup/+register/steps/index.ts
@@ -0,0 +1,4 @@
+export * from './register-step-about.component'
+export * from './register-step-channel.component'
+export * from './register-step-terms.component'
+export * from './register-step-user.component'
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
new file mode 100644
index 000000000..f93de8ce9
--- /dev/null
+++ b/client/src/app/+signup/+register/steps/register-step-about.component.html
@@ -0,0 +1,39 @@
+
+
Why creating an account?
+
+
+ As you probably noticed: creating an account is not necessary to watch video son {{ instanceName }}.
+
+ However, creating an account on {{ instanceName }} will allow you to:
+
+
+
+
Comment videos
+
Subscribe to channels to be notified of new videos
+
Have access to your watch history
+
Create your channel to publish videos
+
+
+
+
+
You're using Mastodon, ActivityPub or a RSS feed aggregator?
+
+
+ You can already follow {{ instanceName }} using your favorite tool.
+
+
+
+
+
+
+
+
+
+
This website is a GAFAM alternative
+
+
+ {{ instanceName }} has been created using PeerTube, a video creation platform developed by Framasoft.
+ Framasoft is a french non-profit organization that offers alternatives to Big Tech's digital tools
+
+ You want to publish videos on {{ instanceName }}? Then you need to create your first channel.
+
+
+
+ You might want to create a channel by theme: for example, you can create a channel named "SweetMelodies"
+ to publish your piano concerts and another one "Ecology" in which you publish your videos talking about ecology.
+
+
+
+ {{ instanceName }} administrators allow you to publish up to {{ videoQuota | bytes: 0 }} of videos on their website.
+
+
+
+
diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/steps/register-step-channel.component.ts
similarity index 94%
rename from client/src/app/+signup/+register/register-step-channel.component.ts
rename to client/src/app/+signup/+register/steps/register-step-channel.component.ts
index 1bc0ccfd3..c10b568ba 100644
--- a/client/src/app/+signup/+register/register-step-channel.component.ts
+++ b/client/src/app/+signup/+register/steps/register-step-channel.component.ts
@@ -9,10 +9,13 @@ import { UserSignupService } from '@app/shared/shared-users'
@Component({
selector: 'my-register-step-channel',
templateUrl: './register-step-channel.component.html',
- styleUrls: [ './register.component.scss' ]
+ styleUrls: [ './step.component.scss' ]
})
export class RegisterStepChannelComponent extends FormReactive implements OnInit {
@Input() username: string
+ @Input() instanceName: string
+ @Input() videoQuota: number
+
@Output() formBuilt = new EventEmitter()
constructor (
diff --git a/client/src/app/+signup/+register/register-step-terms.component.html b/client/src/app/+signup/+register/steps/register-step-terms.component.html
similarity index 74%
rename from client/src/app/+signup/+register/register-step-terms.component.html
rename to client/src/app/+signup/+register/steps/register-step-terms.component.html
index 717a289e6..f54ca77e2 100644
--- a/client/src/app/+signup/+register/register-step-terms.component.html
+++ b/client/src/app/+signup/+register/steps/register-step-terms.component.html
@@ -4,15 +4,13 @@
I am at least {{ minimumAge }} years old and agree
- to the Terms
+ to the Terms and to the Code of Conduct
of this instance
-
- {{ formErrors.terms }}
-
+
{{ formErrors.terms }}
diff --git a/client/src/app/+signup/+register/register-step-terms.component.ts b/client/src/app/+signup/+register/steps/register-step-terms.component.ts
similarity index 96%
rename from client/src/app/+signup/+register/register-step-terms.component.ts
rename to client/src/app/+signup/+register/steps/register-step-terms.component.ts
index 20c1ae1c4..87d16696e 100644
--- a/client/src/app/+signup/+register/register-step-terms.component.ts
+++ b/client/src/app/+signup/+register/steps/register-step-terms.component.ts
@@ -8,7 +8,7 @@ import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
@Component({
selector: 'my-register-step-terms',
templateUrl: './register-step-terms.component.html',
- styleUrls: [ './register.component.scss' ]
+ styleUrls: [ './step.component.scss' ]
})
export class RegisterStepTermsComponent extends FormReactive implements OnInit {
@Input() hasCodeOfConduct = false
diff --git a/client/src/app/+signup/+register/steps/register-step-user.component.html b/client/src/app/+signup/+register/steps/register-step-user.component.html
new file mode 100644
index 000000000..bffcf0346
--- /dev/null
+++ b/client/src/app/+signup/+register/steps/register-step-user.component.html
@@ -0,0 +1,73 @@
+
+ Video uploads are disabled on this instance, hence your account won't be able to upload videos.
+