Add the ability to add participants to already created events

This commit is contained in:
Roman Krček
2025-06-29 17:12:36 +02:00
parent c7275b7ae8
commit 1508b501af
5 changed files with 167 additions and 97 deletions

View File

@@ -37,13 +37,23 @@
<h1 class="mt-2 mb-4 text-center text-2xl font-bold">Event Overview</h1>
<div class="mb-2 rounded border border-gray-300 bg-white p-4">
<div class="flex flex-col gap-1">
{#if loading}
<div class="h-6 w-40 bg-gray-200 rounded animate-pulse mb-2"></div>
<div class="h-4 w-24 bg-gray-100 rounded animate-pulse"></div>
{:else}
<span class="text-black-700 text-lg font-semibold">{event_data?.name}</span>
<span class="text-black-500 text-sm">{event_data?.date}</span>
<div class="flex items-center justify-between gap-4">
<div class="flex flex-col gap-1">
{#if loading}
<div class="mb-2 h-6 w-40 animate-pulse rounded bg-gray-200"></div>
<div class="h-4 w-24 animate-pulse rounded bg-gray-100"></div>
{:else}
<span class="text-gray-700 text-lg font-semibold">{event_data?.name}</span>
<span class="text-gray-500 text-sm">{event_data?.date}</span>
{/if}
</div>
{#if !loading && event_data}
<a
href={`/private/events/creator?eventId=${event_data.id}`}
class="rounded border border-gray-300 bg-blue-600 px-6 py-2 font-semibold text-white transition hover:bg-blue-700"
>
Add Participants
</a>
{/if}
</div>
</div>
@@ -60,7 +70,7 @@
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
</svg>
{#if loading}
<div class="h-4 w-16 bg-gray-200 rounded animate-pulse"></div>
<div class="h-4 w-16 animate-pulse rounded bg-gray-200"></div>
{:else}
<span class="text-sm text-gray-700">Scanned ({scannedCount})</span>
{/if}
@@ -79,7 +89,7 @@
<line x1="16" y1="8" x2="8" y2="16" stroke="currentColor" stroke-width="2" />
</svg>
{#if loading}
<div class="h-4 w-24 bg-gray-200 rounded animate-pulse"></div>
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
{:else}
<span class="text-sm text-gray-700">Not scanned ({notScannedCount})</span>
{/if}
@@ -89,7 +99,7 @@
<div class="rounded border border-gray-300 bg-white p-4">
<h2 class="mb-2 rounded text-xl font-bold">
{#if loading}
<div class="h-6 w-32 bg-gray-200 rounded animate-pulse"></div>
<div class="h-6 w-32 animate-pulse rounded bg-gray-200"></div>
{:else}
Participants ({participants.length})
{/if}
@@ -97,7 +107,7 @@
<ul class="space-y-1">
{#if loading}
<li>
<div class="h-10 w-full bg-gray-200 rounded animate-pulse"></div>
<div class="h-10 w-full animate-pulse rounded bg-gray-200"></div>
</li>
{:else}
{#each participants as p}