From 12d98b4d7e2834ba9de2f9f632e5a961a62afaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Fri, 26 Jun 2026 22:06:15 +0200 Subject: [PATCH] Small fixes --- app/Domains/Event/Controllers/SignupController.php | 5 +++++ app/Domains/Event/Views/Signup.vue | 12 ++++++++++++ app/Domains/Invoice/Controllers/EditController.php | 2 +- app/Resources/EventResource.php | 2 +- version | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/Domains/Event/Controllers/SignupController.php b/app/Domains/Event/Controllers/SignupController.php index 00df3d7..01bcd6d 100644 --- a/app/Domains/Event/Controllers/SignupController.php +++ b/app/Domains/Event/Controllers/SignupController.php @@ -68,6 +68,11 @@ class SignupController extends CommonController { public function signUp(int $eventId, Request $request) { $event = $this->events->getById($eventId, false); + + if (!$event->registration_allowed || new \DateTime() > $event->start_date) { + return response()->json(['status' => 'closed'], 403); + } + $eventResource = $event->toResource(); $registrationData = $request->input('registration_data'); $siblingReduction = $registrationData['sibling'] === 'true'; diff --git a/app/Domains/Event/Views/Signup.vue b/app/Domains/Event/Views/Signup.vue index b0bd3ba..a941154 100644 --- a/app/Domains/Event/Views/Signup.vue +++ b/app/Domains/Event/Views/Signup.vue @@ -99,10 +99,14 @@ function close() {
+
@@ -220,6 +224,14 @@ function close() { word-break: break-all; } +.signup-closed-notice { + text-align: center; + padding: 24px; + color: #991b1b; + font-weight: 600; + font-size: 1rem; +} + /* ─── Tablet (640–1023px) ─── */ @media (max-width: 1023px) { .signup-box { diff --git a/app/Domains/Invoice/Controllers/EditController.php b/app/Domains/Invoice/Controllers/EditController.php index e8e3c28..3dbec7b 100644 --- a/app/Domains/Invoice/Controllers/EditController.php +++ b/app/Domains/Invoice/Controllers/EditController.php @@ -65,7 +65,7 @@ class EditController extends CommonController{ $currentEvents = $this->costUnits->getCostUnitsForNewInvoice(CostUnitType::COST_UNIT_TYPE_EVENT); return response()->json([ - 'invoice' => new InvoiceResource($invoice)->toArray(), + 'invoice' => new InvoiceResource($newInvoice)->toArray(), 'status' => 'success', 'costUnits' => array_merge($runningJobs, $currentEvents), ]); diff --git a/app/Resources/EventResource.php b/app/Resources/EventResource.php index eef36db..72b373b 100644 --- a/app/Resources/EventResource.php +++ b/app/Resources/EventResource.php @@ -34,7 +34,7 @@ class EventResource extends JsonResource{ 'accountIban' => $this->event->account_iban, 'alcoholicsAge' => $this->event->alcoholics_age, 'sendWeeklyReports' => $this->event->send_weekly_report, - 'registrationAllowed' => $this->event->registration_allowed, + 'registrationAllowed' => $this->event->registration_allowed && new \DateTime() <= $this->event->start_date, 'archived' => $this->event->archived, 'earlyBirdEnd' => ['internal' => $this->event->early_bird_end->format('Y-m-d'), 'formatted' => $this->event->early_bird_end->format('d.m.Y')], 'registrationFinalEnd' => ['internal' => $this->event->registration_final_end->format('Y-m-d'), 'formatted' => $this->event->registration_final_end->format('d.m.Y')], diff --git a/version b/version index 6cedcff..4e298cc 100644 --- a/version +++ b/version @@ -1 +1 @@ -4.5.2 +4.5.3