Merge pull request 'development' (#20) from development into main
All checks were successful
Build Docker image / build (push) Successful in 1m15s
Build Docker image / deploy (push) Successful in 8s
Build Docker image / verify (push) Successful in 37s

Reviewed-on: #20
This commit is contained in:
2025-07-14 22:28:06 +02:00
8 changed files with 29 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>

View File

@@ -89,7 +89,7 @@ const authGuard: Handle = async ({ event, resolve }) => {
}
if (!event.locals.session && event.url.pathname.startsWith('/private')) {
redirect(303, '/auth')
redirect(303, '/auth/login')
}
if (event.locals.session && event.url.pathname === '/auth') {

View File

@@ -81,7 +81,7 @@
</button>
<button
onclick={toggleEdit}
class="rounded bg-gray-300 px-4 py-2 text-gray-700 transition hover:bg-gray-400 disabled:cursor-not-allowed disabled:opacity-50"
class="rounded border border-gray-300 bg-white px-4 py-2 text-gray-700 transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50"
disabled={updatingEmail}
aria-label="Cancel editing"
>
@@ -123,7 +123,7 @@
type="text"
bind:value={emailSubject}
disabled={!isEditing || updatingEmail}
class="w-full px-3 py-2 border border-gray-300 rounded-lg {!isEditing ? 'bg-gray-50 cursor-default' : ''} focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-50"
class="w-full rounded-lg border border-gray-300 px-3 py-2 focus:border-blue-500 focus:ring-blue-500 disabled:cursor-default disabled:bg-gray-100"
/>
</div>
@@ -134,7 +134,7 @@
bind:value={emailBody}
rows="6"
disabled={!isEditing || updatingEmail}
class="w-full px-3 py-2 border border-gray-300 rounded-lg {!isEditing ? 'bg-gray-50 cursor-default' : ''} focus:ring-blue-500 focus:border-blue-500 disabled:bg-gray-50"
class="w-full rounded-lg border border-gray-300 px-3 py-2 focus:border-blue-500 focus:ring-blue-500 disabled:cursor-default disabled:bg-gray-100"
></textarea>
{#if isEditing}
<div class="mt-2 text-xs text-gray-500">

View File

@@ -35,7 +35,7 @@
function handleSyncParticipants() {
// Show initial notification about sync starting
toast.info('Starting participant synchronization...', 2000);
toast.info('Starting participant synchronization...', 5000);
// Call the parent component's sync function
onSyncParticipants();
@@ -46,7 +46,7 @@
<div class="mb-4 flex items-center justify-between">
<h2 class="text-xl font-semibold text-gray-900">Participants</h2>
<button
onclick={onSyncParticipants}
onclick={handleSyncParticipants}
disabled={syncingParticipants || !event || loading}
class="rounded bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50"
>

View File

@@ -24,6 +24,11 @@
let eventsError = $state('');
onMount(async () => {
// Load the persisted event ID from local storage
const storedEventId = localStorage.getItem('selectedScannerEventId');
if (storedEventId) {
selectedEventId = storedEventId;
}
await loadEvents();
});
@@ -40,9 +45,14 @@
if (error) throw error;
events = eventsData || [];
// If there are events, select the first one by default
if (events.length > 0) {
// Check if the previously selected event is still in the list
const selectedEventExists = events.some((event) => event.id === selectedEventId);
// If no event is selected, or the selected one is no longer valid, default to the first event
if ((!selectedEventId || !selectedEventExists) && events.length > 0) {
selectedEventId = events[0].id;
} else if (events.length === 0) {
selectedEventId = ''; // No events available
}
} catch (err) {
console.error('Error loading events:', err);
@@ -52,6 +62,13 @@
}
}
// Persist the selected event ID to local storage whenever it changes
$effect(() => {
if (selectedEventId) {
localStorage.setItem('selectedScannerEventId', selectedEventId);
}
});
// Process a scanned QR code
$effect(() => {
if (scanned_id === '') return;

View File

@@ -47,7 +47,7 @@
</div>
<p class="text-amber-700 mb-2">This ticket belongs to a different event:</p>
<div class="bg-white rounded p-3 border border-amber-200 mt-auto">
<p class="font-medium">{ticket_data.event?.name || ''}</p>
<p class="font-bold">{ticket_data.event?.name || ''}</p>
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
</div>
</div>
@@ -64,7 +64,7 @@
{ticket_data.scanned_at ? `on ${formatScannedAt(ticket_data.scanned_at)}` : ''}
</p>
<div class="bg-white rounded p-3 border border-amber-200 mt-auto">
<p class="font-medium">{ticket_data.event?.name || ''}</p>
<p class="font-bold">{ticket_data.event?.name || ''}</p>
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
</div>
</div>
@@ -78,7 +78,7 @@
</div>
<p class="text-green-700">Ticket successfully validated.</p>
<div class="bg-white rounded p-3 border border-green-200 mt-auto">
<p class="font-medium">{ticket_data.event?.name || ''}</p>
<p class="font-bold">{ticket_data.event?.name || ''}</p>
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
</div>
</div>

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB