fixed forfeit button not working on page load

This commit is contained in:
2026-03-15 17:02:19 +11:00
parent 2835ef74fc
commit fd002a7ad0

View File

@@ -520,32 +520,6 @@ templ fixtureResultDisplay(fixture *db.Fixture, result *db.FixtureResult) {
} }
templ fixtureUploadPrompt(fixture *db.Fixture) { templ fixtureUploadPrompt(fixture *db.Fixture) {
<div class="bg-mantle border border-surface1 rounded-lg p-6 text-center">
<div class="text-4xl mb-3">📋</div>
<p class="text-lg text-text font-medium mb-2">No Result Uploaded</p>
<p class="text-sm text-subtext1 mb-4">Upload match log files to record the result of this fixture.</p>
<div class="flex items-center justify-center gap-3">
<a
href={ templ.SafeURL(fmt.Sprintf("/fixtures/%d/results/upload", fixture.ID)) }
class="inline-block px-4 py-2 bg-blue hover:bg-blue/80 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Upload Match Logs
</a>
<button
type="button"
@click="$dispatch('open-forfeit-modal')"
class="inline-block px-4 py-2 bg-red hover:bg-red/80 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Forfeit Match
</button>
</div>
</div>
@forfeitModal(fixture)
}
templ forfeitModal(fixture *db.Fixture) {
<div <div
x-data="{ x-data="{
open: false, open: false,
@@ -553,7 +527,35 @@ templ forfeitModal(fixture *db.Fixture) {
forfeitTeam: '', forfeitTeam: '',
forfeitReason: '', forfeitReason: '',
}" }"
@open-forfeit-modal.window="open = true" >
<div class="bg-mantle border border-surface1 rounded-lg p-6 text-center">
<div class="text-4xl mb-3">📋</div>
<p class="text-lg text-text font-medium mb-2">No Result Uploaded</p>
<p class="text-sm text-subtext1 mb-4">Upload match log files to record the result of this fixture.</p>
<div class="flex items-center justify-center gap-3">
<a
href={ templ.SafeURL(fmt.Sprintf("/fixtures/%d/results/upload", fixture.ID)) }
class="inline-block px-4 py-2 bg-blue hover:bg-blue/80 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Upload Match Logs
</a>
<button
type="button"
@click="open = true"
class="inline-block px-4 py-2 bg-red hover:bg-red/80 text-mantle rounded-lg
font-medium transition hover:cursor-pointer"
>
Forfeit Match
</button>
</div>
</div>
@forfeitModal(fixture)
</div>
}
templ forfeitModal(fixture *db.Fixture) {
<div
x-show="open" x-show="open"
x-cloak x-cloak
class="fixed inset-0 z-50 overflow-y-auto" class="fixed inset-0 z-50 overflow-y-auto"