mirror of https://github.com/Chocobozzz/PeerTube
parent
ffc12d3ad5
commit
09c55770bc
|
@ -1,5 +1,5 @@
|
||||||
<section class="container">
|
<section class="container">
|
||||||
<header>
|
<header *ngIf="steps.length > 2">
|
||||||
<ng-container *ngFor="let step of steps; let i = index; let isLast = last;">
|
<ng-container *ngFor="let step of steps; let i = index; let isLast = last;">
|
||||||
<div
|
<div
|
||||||
class="step-info" [ngClass]="{ active: selectedIndex === i, completed: isCompleted(step) }" [attr.aria-current]="selectedIndex === i"
|
class="step-info" [ngClass]="{ active: selectedIndex === i, completed: isCompleted(step) }" [attr.aria-current]="selectedIndex === i"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<form role="form" [formGroup]="form">
|
<form role="form" [formGroup]="form">
|
||||||
|
|
||||||
|
<div class="capability-information alert alert-info" i18n *ngIf="videoUploadDisabled">
|
||||||
|
Video uploads are disabled on this instance, hence your account won't be able to upload videos.
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="displayName" i18n>Display name</label>
|
<label for="displayName" i18n>Display name</label>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
||||||
})
|
})
|
||||||
export class RegisterStepUserComponent extends FormReactive implements OnInit {
|
export class RegisterStepUserComponent extends FormReactive implements OnInit {
|
||||||
@Input() hasCodeOfConduct = false
|
@Input() hasCodeOfConduct = false
|
||||||
|
@Input() videoUploadDisabled = false
|
||||||
|
|
||||||
@Output() formBuilt = new EventEmitter<FormGroup>()
|
@Output() formBuilt = new EventEmitter<FormGroup>()
|
||||||
@Output() termsClick = new EventEmitter<void>()
|
@Output() termsClick = new EventEmitter<void>()
|
||||||
|
|
|
@ -13,14 +13,16 @@
|
||||||
<cdk-step [stepControl]="formStepUser" i18n-label label="User">
|
<cdk-step [stepControl]="formStepUser" i18n-label label="User">
|
||||||
<my-register-step-user
|
<my-register-step-user
|
||||||
[hasCodeOfConduct]="!!aboutHtml.codeOfConduct"
|
[hasCodeOfConduct]="!!aboutHtml.codeOfConduct"
|
||||||
|
[videoUploadDisabled]="videoUploadDisabled"
|
||||||
(formBuilt)="onUserFormBuilt($event)" (termsClick)="onTermsClick()" (codeOfConductClick)="onCodeOfConductClick()"
|
(formBuilt)="onUserFormBuilt($event)" (termsClick)="onTermsClick()" (codeOfConductClick)="onCodeOfConductClick()"
|
||||||
>
|
>
|
||||||
</my-register-step-user>
|
</my-register-step-user>
|
||||||
|
|
||||||
<button i18n cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid">Next</button>
|
<button i18n cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid"
|
||||||
|
(click)="signup()">{{ videoUploadDisabled ? 'Signup' : 'Next' }}</button>
|
||||||
</cdk-step>
|
</cdk-step>
|
||||||
|
|
||||||
<cdk-step [stepControl]="formStepChannel" i18n-label label="Channel">
|
<cdk-step [stepControl]="formStepChannel" i18n-label label="Channel" *ngIf="!videoUploadDisabled">
|
||||||
<my-register-step-channel (formBuilt)="onChannelFormBuilt($event)" [username]="getUsername()"></my-register-step-channel>
|
<my-register-step-channel (formBuilt)="onChannelFormBuilt($event)" [username]="getUsername()"></my-register-step-channel>
|
||||||
|
|
||||||
<button i18n cdkStepperNext (click)="signup()"
|
<button i18n cdkStepperNext (click)="signup()"
|
||||||
|
|
|
@ -30,6 +30,8 @@ export class RegisterComponent implements OnInit {
|
||||||
administrator: ''
|
administrator: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
videoUploadDisabled: boolean
|
||||||
|
|
||||||
formStepUser: FormGroup
|
formStepUser: FormGroup
|
||||||
formStepChannel: FormGroup
|
formStepChannel: FormGroup
|
||||||
|
|
||||||
|
@ -52,6 +54,8 @@ export class RegisterComponent implements OnInit {
|
||||||
ngOnInit (): void {
|
ngOnInit (): void {
|
||||||
this.serverConfig = this.route.snapshot.data.serverConfig
|
this.serverConfig = this.route.snapshot.data.serverConfig
|
||||||
|
|
||||||
|
this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
|
||||||
|
|
||||||
this.instanceService.getAbout()
|
this.instanceService.getAbout()
|
||||||
.subscribe(
|
.subscribe(
|
||||||
async about => {
|
async about => {
|
||||||
|
@ -102,7 +106,7 @@ export class RegisterComponent implements OnInit {
|
||||||
this.error = null
|
this.error = null
|
||||||
|
|
||||||
const body: UserRegister = await this.hooks.wrapObject(
|
const body: UserRegister = await this.hooks.wrapObject(
|
||||||
Object.assign(this.formStepUser.value, { channel: this.formStepChannel.value }),
|
Object.assign(this.formStepUser.value, { channel: this.videoUploadDisabled ? undefined : this.formStepChannel.value }),
|
||||||
'signup',
|
'signup',
|
||||||
'filter:api.signup.registration.create.params'
|
'filter:api.signup.registration.create.params'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue