<section class="container">
- <header>
+ <header *ngIf="steps.length > 2">
<ng-container *ngFor="let step of steps; let i = index; let isLast = last;">
<div
class="step-info" [ngClass]="{ active: selectedIndex === i, completed: isCompleted(step) }" [attr.aria-current]="selectedIndex === i"
<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">
<label for="displayName" i18n>Display name</label>
})
export class RegisterStepUserComponent extends FormReactive implements OnInit {
@Input() hasCodeOfConduct = false
+ @Input() videoUploadDisabled = false
@Output() formBuilt = new EventEmitter<FormGroup>()
@Output() termsClick = new EventEmitter<void>()
<cdk-step [stepControl]="formStepUser" i18n-label label="User">
<my-register-step-user
[hasCodeOfConduct]="!!aboutHtml.codeOfConduct"
+ [videoUploadDisabled]="videoUploadDisabled"
(formBuilt)="onUserFormBuilt($event)" (termsClick)="onTermsClick()" (codeOfConductClick)="onCodeOfConductClick()"
>
</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 [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>
<button i18n cdkStepperNext (click)="signup()"
administrator: ''
}
+ videoUploadDisabled: boolean
+
formStepUser: FormGroup
formStepChannel: FormGroup
ngOnInit (): void {
this.serverConfig = this.route.snapshot.data.serverConfig
+ this.videoUploadDisabled = this.serverConfig.user.videoQuota === 0
+
this.instanceService.getAbout()
.subscribe(
async about => {
this.error = null
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',
'filter:api.signup.registration.create.params'
)