From ed9d41cdc607b7dc173c0b661f0c2c56d1801ec0 Mon Sep 17 00:00:00 2001 From: akastijn Date: Fri, 17 Oct 2025 22:00:23 +0200 Subject: [PATCH] Add conditional display logic to staff application form based on open/close status --- .../staff-application.component.html | 573 +++++++++--------- .../staff-application.component.ts | 4 + 2 files changed, 294 insertions(+), 283 deletions(-) diff --git a/frontend/src/app/pages/forms/staff-application/staff-application.component.html b/frontend/src/app/pages/forms/staff-application/staff-application.component.html index 6080fac..c564282 100644 --- a/frontend/src/app/pages/forms/staff-application/staff-application.component.html +++ b/frontend/src/app/pages/forms/staff-application/staff-application.component.html @@ -6,313 +6,320 @@
-
-
-
- - @if (currentPageIndex === 0) { -
- Logo -

Moderator Application

-

Thank you for your interest in becoming a moderator on our Minecraft server.

-

Please take your time to fill out this application thoroughly.

- -
- } - - - @if (currentPageIndex === 1) { -
-
-

You are logged in as {{ authService.username() }}. If this is the correct account - please continue

-
-

Notice: Submitting a staff application is not an instant process. - We will review your application carefully and get back to you if we think you're a good fit.

-

Applications that seem to have been made with - little to no effort will be automatically rejected.

-
- -
- } - -
- - @if (currentPageIndex === 2) { + @if (staffApplicationsIsOpen()) { +
+
+
+ + @if (currentPageIndex === 0) {
-
-

Basic Information

- - - - Email - - @if (form.controls.email.invalid && form.controls.email.touched) { - - @if (form.controls.email.errors?.['required']) { - Email is required - } @else if (form.controls.email.errors?.['email']) { - Please enter a valid email address - } - - } - - @if (emailIsValid()) { -
- - check - You have validated your email previously. - -
- } @else { -
- - close - You have not used this email address before. Before going to the next page you will be asked to verify it. - -
- } - - - - Age - - @if (form.controls.age.invalid && form.controls.age.touched) { - - @if (form.controls.age.errors?.['required']) { - Age is required - } @else if (form.controls.age.errors?.['min']) { - You must be at least 13 years old - } @else if (form.controls.age.errors?.['pattern']) { - Please enter a valid number - } - - } - - - - - Discord Username - - @if (form.controls.discordUsername.invalid && form.controls.discordUsername.touched) { - - Discord username is required - - } - - - -
- - I confirm that I meet the PC requirements (able to record video at 30fps 720p or higher, and able - to talk in voice chat) - - @if (form.controls.meetsRequirements.invalid && form.controls.meetsRequirements.touched) { - - You must meet the PC requirements to apply - - } -
- - - - Pronouns (Optional) - - -
-
} - - @if (currentPageIndex === 3) { + + @if (currentPageIndex === 1) {
-

Experience & Availability

+

You are logged in as {{ authService.username() }}. If this is the correct account + please continue

+
+

Notice: Submitting a staff application is not an instant + process. + We will review your application carefully and get back to you if we think you're a good fit.

+

Applications that seem to have been made with + little to no effort will be automatically rejected.

+
+ +
+ } - - - When did you join our server? (Estimate) - - - - @if (form.controls.joinDate.invalid && form.controls.joinDate.touched) { - - Join date is required - + + + @if (currentPageIndex === 2) { +
+
+

Basic Information

+ + + + Email + + @if (form.controls.email.invalid && form.controls.email.touched) { + + @if (form.controls.email.errors?.['required']) { + Email is required + } @else if (form.controls.email.errors?.['email']) { + Please enter a valid email address + } + + } + + @if (emailIsValid()) { +
+ + check + You have validated your email previously. + +
+ } @else { +
+ + close + You have not used this email address before. Before going to the next page you will be asked to verify it. + +
} - - - - Average expected playtime in a week (hours) - - @if (form.controls.weeklyPlaytime.invalid && form.controls.weeklyPlaytime.touched) { - - @if (form.controls.weeklyPlaytime.errors?.['required']) { - Weekly playtime is required - } @else if (form.controls.weeklyPlaytime.errors?.['min']) { - Weekly playtime must be at least 1 hour - } - - } - + + + Age + + @if (form.controls.age.invalid && form.controls.age.touched) { + + @if (form.controls.age.errors?.['required']) { + Age is required + } @else if (form.controls.age.errors?.['min']) { + You must be at least 13 years old + } @else if (form.controls.age.errors?.['pattern']) { + Please enter a valid number + } + + } + - -
- -
- @for (day of availableDays; track day) { -
- {{ day }} -
+ + + Discord Username + + @if (form.controls.discordUsername.invalid && form.controls.discordUsername.touched) { + + Discord username is required + + } + + + +
+ + I confirm that I meet the PC requirements (able to record video at 30fps 720p or higher, and + able + to talk in voice chat) + + @if (form.controls.meetsRequirements.invalid && form.controls.meetsRequirements.touched) { + + You must meet the PC requirements to apply + }
- @if (form.controls.availableDays.invalid && form.controls.availableDays.touched) { - - Please select at least one day - - } + + + + Pronouns (Optional) + +
+ +
+ } - - - Available times (Your timezone: {{ userTimezone }}) - - @if (form.controls.availableTimes.invalid && form.controls.availableTimes.touched) { - - Available times are required - - } - -
- -
- } + + @if (currentPageIndex === 3) { +
+
+

Experience & Availability

- - @if (currentPageIndex === 4) { -
-
-

Qualifications & Expectations

+ + + When did you join our server? (Estimate) + + + + @if (form.controls.joinDate.invalid && form.controls.joinDate.touched) { + + Join date is required + + } + - - - Previous experience (here or in other relevant places) - - @if (form.controls.previousExperience.invalid && form.controls.previousExperience.touched) { - - @if (form.controls.previousExperience.errors?.['required']) { - Previous experience is required - } @else if (form.controls.previousExperience.errors?.['minlength']) { - Please provide more details (at least 10 characters) + + + Average expected playtime in a week (hours) + + @if (form.controls.weeklyPlaytime.invalid && form.controls.weeklyPlaytime.touched) { + + @if (form.controls.weeklyPlaytime.errors?.['required']) { + Weekly playtime is required + } @else if (form.controls.weeklyPlaytime.errors?.['min']) { + Weekly playtime must be at least 1 hour + } + + } + + + +
+ +
+ @for (day of availableDays; track day) { +
+ {{ day }} +
} - - } - +
+ @if (form.controls.availableDays.invalid && form.controls.availableDays.touched) { + + Please select at least one day + + } +
- - - Experience with plugins that players use on our server - - @if (form.controls.pluginExperience.invalid && form.controls.pluginExperience.touched) { - - @if (form.controls.pluginExperience.errors?.['required']) { - Plugin experience is required - } @else if (form.controls.pluginExperience.errors?.['minlength']) { - Please provide more details (at least 10 characters) - } - - } - + + + Available times (Your timezone: {{ userTimezone }}) + + @if (form.controls.availableTimes.invalid && form.controls.availableTimes.touched) { + + Available times are required + + } + +
+ +
+ } - - - What do you believe the expectations of a moderator are? - - @if (form.controls.moderatorExpectations.invalid && form.controls.moderatorExpectations.touched) { - - @if (form.controls.moderatorExpectations.errors?.['required']) { - Moderator expectations are required - } @else if (form.controls.moderatorExpectations.errors?.['minlength']) { - Please provide more details (at least 10 characters) - } - - } - + + @if (currentPageIndex === 4) { +
+
+

Qualifications & Expectations

- - - Additional Information (Optional) - - -
- -
- } - -
+ + + Previous experience (here or in other relevant places) + + @if (form.controls.previousExperience.invalid && form.controls.previousExperience.touched) { + + @if (form.controls.previousExperience.errors?.['required']) { + Previous experience is required + } @else if (form.controls.previousExperience.errors?.['minlength']) { + Please provide more details (at least 10 characters) + } + + } + - - @if (totalPages.length > 1) { -
- + + + Experience with plugins that players use on our server + + @if (form.controls.pluginExperience.invalid && form.controls.pluginExperience.touched) { + + @if (form.controls.pluginExperience.errors?.['required']) { + Plugin experience is required + } @else if (form.controls.pluginExperience.errors?.['minlength']) { + Please provide more details (at least 10 characters) + } + + } + - @for (i of totalPages; track i) { - - } + + + What do you believe the expectations of a moderator are? + + @if (form.controls.moderatorExpectations.invalid && form.controls.moderatorExpectations.touched) { + + @if (form.controls.moderatorExpectations.errors?.['required']) { + Moderator expectations are required + } @else if (form.controls.moderatorExpectations.errors?.['minlength']) { + Please provide more details (at least 10 characters) + } + + } + - + + + Additional Information (Optional) + + +
+ +
+ } +
- } -
-
+ + + @if (totalPages.length > 1) { +
+ + + @for (i of totalPages; track i) { + + } + + +
+ } + + + } @else { +

Staff applications are closed at this time. Please keep an eye on our announcement channel in Discord to see + when it opens!

+ }
diff --git a/frontend/src/app/pages/forms/staff-application/staff-application.component.ts b/frontend/src/app/pages/forms/staff-application/staff-application.component.ts index 5dc428d..05805de 100644 --- a/frontend/src/app/pages/forms/staff-application/staff-application.component.ts +++ b/frontend/src/app/pages/forms/staff-application/staff-application.component.ts @@ -68,6 +68,7 @@ export class StaffApplicationComponent implements OnInit, OnDestroy, AfterViewIn protected availableDays: string[] = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; protected selectedDays: string[] = []; protected userTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone; + protected staffApplicationsIsOpen = signal(false) constructor( @@ -151,6 +152,9 @@ export class StaffApplicationComponent implements OnInit, OnDestroy, AfterViewIn } ngOnInit() { + this.staffApplicationService.getStaffApplicationsIsOpen().subscribe(isOpen => { + this.staffApplicationsIsOpen.set(isOpen) + }) const uuid = this.authService.getUuid(); if (uuid === null) { alert('Error retrieving token, please relog on the website and try again')