From be9470d669acd74339f7010e35ea715590e33433 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 17 Oct 2025 15:58:54 +0200 Subject: [PATCH] quick ui cleanup --- .../(tournament)/tournament/+page.svelte | 111 +++++++++--------- .../tournament/[slug]/+page.svelte | 5 - .../[registration]/+page.svelte | 39 +++--- 3 files changed, 74 insertions(+), 81 deletions(-) diff --git a/web/src/routes/(tournament)/tournament/+page.svelte b/web/src/routes/(tournament)/tournament/+page.svelte index 5e076c9..9fcfafa 100644 --- a/web/src/routes/(tournament)/tournament/+page.svelte +++ b/web/src/routes/(tournament)/tournament/+page.svelte @@ -20,17 +20,19 @@ const tournaments = $derived(() => sortTournaments(tournamentList)); function upsertTournament(tournament: TournamentInfo) { - const index = tournamentList.findIndex((item) => item.id === tournament.id); + const index = tournamentList.findIndex((item: { id: number }) => item.id === tournament.id); if (index >= 0) { - tournamentList = tournamentList.map((item, idx) => (idx === index ? tournament : item)); + tournamentList = tournamentList.map((item: any, idx: any) => + idx === index ? tournament : item + ); return; } tournamentList = [...tournamentList, tournament]; } function removeTournament(id: number) { - if (!tournamentList.some((item) => item.id === id)) return; - tournamentList = tournamentList.filter((item) => item.id !== id); + if (!tournamentList.some((item: { id: number }) => item.id === id)) return; + tournamentList = tournamentList.filter((item: { id: number }) => item.id !== id); } function formatDate(value: string | null) { @@ -63,10 +65,10 @@ return `${count} ${count === 1 ? 'spelare' : 'spelare'}`; } -onMount(() => { - const stop = listenToTournamentEvents(upsertTournament, removeTournament, { - endpoint: '/api/public-events' - }); + onMount(() => { + const stop = listenToTournamentEvents(upsertTournament, removeTournament, { + endpoint: '/api/public-events' + }); return () => { stop(); }; @@ -80,66 +82,59 @@ onMount(() => {
-

VBytes LAN

+

VBytes LAN

Turneringar

-

- Samla laget, följ brackets i realtid och håll koll på allt som händer under turneringarna. -

{#if tournaments().length > 0}
{#each tournaments() as tournament} -
-
- {tournament.game} - - {registrationSummary(tournament)} - -
-

{tournament.title}

- {#if tournament.tagline} -

{tournament.tagline}

- {:else if tournament.description} -

{tournament.description}

- {/if} -
- {#if tournament.start_at} -
- Start: - {formatDate(tournament.start_at) ?? tournament.start_at} -
- {/if} - {#if tournament.location} -
- Plats: - {tournament.location} -
- {/if} - {#if tournament.contact} -
- Kontakt: - {tournament.contact} -
- {/if} -
-
- {#if tournament.slug} - +
+
+ {tournament.game} + - Visa turnering - - {:else} - Ingen publik sida tillgänglig. + {registrationSummary(tournament)} + +
+

{tournament.title}

+ {#if tournament.tagline} +

{tournament.tagline}

+ {:else if tournament.description} +

{tournament.description}

{/if} -
-
+
+ {#if tournament.start_at} +
+ Start: + {formatDate(tournament.start_at) ?? tournament.start_at} +
+ {/if} + {#if tournament.location} +
+ Plats: + {tournament.location} +
+ {/if} + {#if tournament.contact} +
+ Kontakt: + {tournament.contact} +
+ {/if} +
+ + {/each}
{:else} -

+

Inga turneringar är publicerade ännu. Kom tillbaka senare!

{/if} @@ -147,7 +142,7 @@ onMount(() => {
Till admin diff --git a/web/src/routes/(tournament)/tournament/[slug]/+page.svelte b/web/src/routes/(tournament)/tournament/[slug]/+page.svelte index 6d3dcaf..848a9f5 100644 --- a/web/src/routes/(tournament)/tournament/[slug]/+page.svelte +++ b/web/src/routes/(tournament)/tournament/[slug]/+page.svelte @@ -418,11 +418,6 @@ Anmälan bekräftad

Du är registrerad till {tournament.title}.

- {#if signup.successRegistrationId} -

- Anmälan #{signup.successRegistrationId} -

- {/if}
- import type { - TournamentRegistrationDetail, - TournamentSignupField - } from '$lib/types'; + import type { TournamentRegistrationDetail, TournamentSignupField } from '$lib/types'; const props = $props<{ data: TournamentRegistrationDetail }>(); const { tournament, registration } = props.data; @@ -39,18 +36,20 @@
-

VBytes LAN

+

VBytes LAN

Anmälan bekräftad

Du är registrerad till {tournament.title}.

-

- Skapad {formatDateTime(registration.created_at) ?? registration.created_at} -

-
+

Turnering

-

Spel: {tournament.game}

+

+ Spel: + {tournament.game} +

{#if tournament.start_at}

Start: @@ -59,7 +58,8 @@ {/if} {#if tournament.location}

- Plats: {tournament.location} + Plats: + {tournament.location}

{/if}
@@ -75,7 +75,8 @@ {/if} {#if tournament.contact}

- Kontakt: {tournament.contact} + Kontakt: + {tournament.contact}

{/if}
@@ -84,14 +85,16 @@

Anmälningsuppgifter

{#if entryFields.length === 0} -

+

Den här turneringen kräver inga uppgifter utöver spelare.

{:else}
{#each entryFields as field}
-

{field.label}

+

{field.label}

{fieldValue(entryValues, field) || '—'}

{/each} @@ -113,7 +116,9 @@
{#each participantValues as participant, index}
-

Spelare {index + 1}

+

+ Spelare {index + 1} +

    {#each participantFields as field}
  • @@ -129,9 +134,7 @@