From bb61ae87ded07506ee5de775acfb5d50870214b9 Mon Sep 17 00:00:00 2001 From: bernardhanna Date: Tue, 13 Oct 2026 09:29:50 +0100 Subject: [PATCH 1/2] Cap event detail hero images at 500px tall. Large imported photos were blowing out the first viewport with a fixed 520px desktop height. Co-authored-by: Cursor --- resources/views/event/show.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/event/show.blade.php b/resources/views/event/show.blade.php index eace7636a..472a4d8a9 100644 --- a/resources/views/event/show.blade.php +++ b/resources/views/event/show.blade.php @@ -75,7 +75,7 @@ @endif
- +
@canany(['edit', 'delete'], $event) From f2dd9db112c45036f99e624b4f1340497b5ea488 Mon Sep 17 00:00:00 2001 From: bernardhanna Date: Wed, 14 Oct 2026 17:23:37 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Now=20run=20check.Fixed=20in=20code;=20Lina?= =?UTF-8?q?'s=20own=20record=20still=20needs=20the=20code=20s=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Creation paths that skip EventsQuery::store() (imports set '', Nova) hit this - - Change: 5 lines in approve() - if empty, set cw{yy}-{5 random alnum} in same update() call before mail is queued - Matches pattern used by support tool /^cw\d{2}-[A-Za-z0-9]+$/ - - Test: added to tests/Feature/ApproveEventTest.php, asserts generated code + code present in rendered mail --- app/Event.php | 5 +++++ tests/Feature/ApproveEventTest.php | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/app/Event.php b/app/Event.php index 2c4060212..0857e36e1 100644 --- a/app/Event.php +++ b/app/Event.php @@ -416,6 +416,11 @@ public function approve() { $data = ['status' => 'APPROVED', 'approved_by' => auth()->user()->id]; + // Imported/Nova-created events can reach approval without a code, and the email prints it verbatim. + if (empty($this->codeweek_for_all_participation_code)) { + $data['codeweek_for_all_participation_code'] = 'cw'.now()->format('y').'-'.Str::random(5); + } + $this->update($data); if (! empty($this->user_email)) { diff --git a/tests/Feature/ApproveEventTest.php b/tests/Feature/ApproveEventTest.php index ff6501eb4..bbb036125 100644 --- a/tests/Feature/ApproveEventTest.php +++ b/tests/Feature/ApproveEventTest.php @@ -194,4 +194,31 @@ public function ambassadors_of_right_country_can_see_the_approve_banner(): void ->assertSee('moderate-event'); } + + #[Test] + public function approving_event_without_participation_code_generates_one_for_the_email(): void + { + $this->withExceptionHandling(); + + Mail::fake(); + + $superadmin = \App\User::factory()->create(); + $superadmin->assignRole('super admin'); + + $this->signIn($superadmin); + + $event = \App\Event::factory()->create([ + 'status' => 'PENDING', + 'user_email' => 'foo@bar.com', + 'codeweek_for_all_participation_code' => null, + ]); + + $event->approve(); + + $event = $event->fresh(); + $code = (string) $event->codeweek_for_all_participation_code; + + $this->assertMatchesRegularExpression('/^cw\d{2}-[A-Za-z0-9]+$/', $code); + $this->assertStringContainsString($code, (new EventApproved($event, $event->owner))->render()); + } }