From 8c620abbe6eff71881a5f100ba67bf8b7da95ec1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 24 Feb 2026 21:53:49 +0100 Subject: [PATCH] fixes --- .../ParticipantRegistrationRequest.cs | 1 - .../lan-frontend/app/admin/dashboard/page.tsx | 14 ++ src/Web/lan-frontend/app/page.tsx | 182 ++++++++++-------- src/Web/lan-frontend/app/register/page.tsx | 25 +-- src/Web/lan-frontend/app/volunteer/page.tsx | 22 +++ 5 files changed, 147 insertions(+), 97 deletions(-) diff --git a/src/Registration/Registration.API/RequestModels/ParticipantRegistrationRequest.cs b/src/Registration/Registration.API/RequestModels/ParticipantRegistrationRequest.cs index 61f75c3..d7b36b0 100644 --- a/src/Registration/Registration.API/RequestModels/ParticipantRegistrationRequest.cs +++ b/src/Registration/Registration.API/RequestModels/ParticipantRegistrationRequest.cs @@ -20,7 +20,6 @@ public class ParticipantRegistrationRequest public string? PhoneNumber { get; set; } - [EmailAddress] public string? Email { get; set; } [Required] diff --git a/src/Web/lan-frontend/app/admin/dashboard/page.tsx b/src/Web/lan-frontend/app/admin/dashboard/page.tsx index ca7a895..f1bdc0c 100644 --- a/src/Web/lan-frontend/app/admin/dashboard/page.tsx +++ b/src/Web/lan-frontend/app/admin/dashboard/page.tsx @@ -15,6 +15,7 @@ interface EventContent { rulesAndGdpr: string; additionalInfo: string; registrationEnabled: boolean; + volunteerRegistrationEnabled?: boolean; visitorOnly: boolean; volunteerAreas: string; } @@ -128,6 +129,19 @@ export default function AdminDashboard() { Endast Besöks-registrering (Ingen Dator) +
+ setContent(prev => prev ? { ...prev, volunteerRegistrationEnabled: e.target.checked } : null)} + /> + +
diff --git a/src/Web/lan-frontend/app/page.tsx b/src/Web/lan-frontend/app/page.tsx index 1f836ab..8fe8589 100644 --- a/src/Web/lan-frontend/app/page.tsx +++ b/src/Web/lan-frontend/app/page.tsx @@ -15,6 +15,7 @@ interface EventContent { rulesAndGdpr: string; additionalInfo: string; registrationEnabled: boolean; + volunteerRegistrationEnabled?: boolean; visitorOnly: boolean; volunteerAreas: string; } @@ -73,98 +74,111 @@ export default function LandingPage() { {/* Info Section */}
- {(content.eventDate || - content.eventTime || - content.locationName || - content.locationAddress || - content.additionalInfo) && ( -
-

- Information -

-
- {(content.eventDate || content.eventTime) && ( -
-

- Tid/Datum -

- {content.eventDate &&

{content.eventDate}

} - {content.eventTime &&

{content.eventTime}

} -
- )} - {(content.locationName || content.locationAddress) && ( -
-

Plats

- {content.locationName &&

{content.locationName}

} - {content.locationAddress &&

{content.locationAddress}

} -
- )} -
- {content.additionalInfo && ( -
- {content.additionalInfo} -
- )} -
- )} - - {content.whatToBring && ( -
-

- Ta Med(bokad LAN-plats) -

-
    - {content.whatToBring - .split("\n") - .filter((line) => line.trim()) - .map((line, i) => ( -
  • {line}
  • - ))} -
-
- )} - - {content.rulesAndGdpr && ( -
-

- Regler för LAN & GDPR -

-

- {content.rulesAndGdpr} + {!content.registrationEnabled ? ( +

+

Anmälan är stängd

+

+ Vi tar tyvärr inte emot fler anmälningar just nu. Håll utkik för framtida evenemang!

- )} + ) : ( + <> + {(content.eventDate || + content.eventTime || + content.locationName || + content.locationAddress || + content.additionalInfo) && ( +
+

+ Information +

+
+ {(content.eventDate || content.eventTime) && ( +
+

+ Tid/Datum +

+ {content.eventDate &&

{content.eventDate}

} + {content.eventTime &&

{content.eventTime}

} +
+ )} + {(content.locationName || content.locationAddress) && ( +
+

Plats

+ {content.locationName &&

{content.locationName}

} + {content.locationAddress &&

{content.locationAddress}

} +
+ )} +
+ {content.additionalInfo && ( +
+ {content.additionalInfo} +
+ )} +
+ )} - {/* Call to Action */} - {content.registrationEnabled && ( -
-
-

Vill du delta?

-

- Begränsade platser, Säkra din plats idag! -

-
- - Anmäl dig nu - -
+ {content.whatToBring && ( +
+

+ Ta Med(bokad LAN-plats) +

+
    + {content.whatToBring + .split("\n") + .filter((line) => line.trim()) + .map((line, i) => ( +
  • {line}
  • + ))} +
+
+ )} + + {content.rulesAndGdpr && ( +
+

+ Regler för LAN & GDPR +

+

+ {content.rulesAndGdpr} +

+
+ )} + + {/* Call to Action */} + {content.registrationEnabled && ( +
+
+

Vill du delta?

+

+ Begränsade platser, Säkra din plats idag! +

+
+ + Anmäl dig nu + +
+ )} + )}
{/* Footer */}
-
-

Vill du hjälpa till?

- - Bli Funktionär - -
+ {(content.volunteerRegistrationEnabled ?? true) && ( +
+

Vill du hjälpa till?

+ + Bli Funktionär + +
+ )}

© 2026 Vbytes Gaming. Alla rättigheter förbehållna.

diff --git a/src/Web/lan-frontend/app/register/page.tsx b/src/Web/lan-frontend/app/register/page.tsx index 991f80e..acea8f7 100644 --- a/src/Web/lan-frontend/app/register/page.tsx +++ b/src/Web/lan-frontend/app/register/page.tsx @@ -169,10 +169,6 @@ export default function RegisterPage() { "Vårdnadshavarens e-postadress är ogiltig."; } - if (formData.email.trim() && !isValidEmail(formData.email.trim())) { - nextFieldErrors.email = "Din e-postadress är ogiltig."; - } - if (!formData.hasApprovedGdpr) { nextFieldErrors.hasApprovedGdpr = "Du måste godkänna GDPR för att anmäla dig."; } @@ -240,7 +236,9 @@ export default function RegisterPage() { if (response.ok) { setMessage({ type: "success", - text: "Registreringen är klar! Du är nu anmäld till LAN:et.", + text: isMember + ? "Registreringen är klar! Du är nu anmäld till LAN:et." + : "Din anmälan är mottagen, men det återstår ett viktigt steg för att du ska få delta.", }); setShowBecomeMemberCta(!isMember); @@ -300,19 +298,22 @@ export default function RegisterPage() { {message.type === "success" && (
-
🎉
-

Klart!

+
{showBecomeMemberCta ? "⏳" : "🎉"}
+

+ {showBecomeMemberCta ? "Nästan Klart!" : "Klart!"} +

{message.text}

{showBecomeMemberCta && ( -
+

Du är inte medlem än

- Vi hittade dig inte i vårt medlemsregister. Genom att bli - medlem i vBytes hjälper du oss att anordna fler och bättre + Vi hittade dig inte i vårt medlemsregister. För att kunna + delta på LAN:et måste du vara medlem i vBytes. Medlemskapet är + gratis och hjälper oss dessutom att anordna fler och bättre LAN!

- {message.text && ( + {message.text && message.type !== "success" && (
@@ -42,6 +43,27 @@ export default function VolunteerPage() { .then((data) => setContent(data)) .catch((err) => console.error("Failed to fetch content", err)); }, []); + + if (content && content.volunteerRegistrationEnabled === false) { + return ( +
+
+

+ Anmälan är stängd +

+

+ Vi tar tyvärr inte emot fler funktionärsanmälningar just nu. +

+ +
+
+ ); + } const handleInputChange = (e: React.ChangeEvent) => { const { name, value, type, checked } = e.target;