Merge pull request 'development' (#20) from development into main
Reviewed-on: #20
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<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" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const authGuard: Handle = async ({ event, resolve }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!event.locals.session && event.url.pathname.startsWith('/private')) {
|
if (!event.locals.session && event.url.pathname.startsWith('/private')) {
|
||||||
redirect(303, '/auth')
|
redirect(303, '/auth/login')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.locals.session && event.url.pathname === '/auth') {
|
if (event.locals.session && event.url.pathname === '/auth') {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onclick={toggleEdit}
|
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}
|
disabled={updatingEmail}
|
||||||
aria-label="Cancel editing"
|
aria-label="Cancel editing"
|
||||||
>
|
>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
type="text"
|
type="text"
|
||||||
bind:value={emailSubject}
|
bind:value={emailSubject}
|
||||||
disabled={!isEditing || updatingEmail}
|
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>
|
</div>
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@
|
|||||||
bind:value={emailBody}
|
bind:value={emailBody}
|
||||||
rows="6"
|
rows="6"
|
||||||
disabled={!isEditing || updatingEmail}
|
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>
|
></textarea>
|
||||||
{#if isEditing}
|
{#if isEditing}
|
||||||
<div class="mt-2 text-xs text-gray-500">
|
<div class="mt-2 text-xs text-gray-500">
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
function handleSyncParticipants() {
|
function handleSyncParticipants() {
|
||||||
|
|
||||||
// Show initial notification about sync starting
|
// 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
|
// Call the parent component's sync function
|
||||||
onSyncParticipants();
|
onSyncParticipants();
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<div class="mb-4 flex items-center justify-between">
|
<div class="mb-4 flex items-center justify-between">
|
||||||
<h2 class="text-xl font-semibold text-gray-900">Participants</h2>
|
<h2 class="text-xl font-semibold text-gray-900">Participants</h2>
|
||||||
<button
|
<button
|
||||||
onclick={onSyncParticipants}
|
onclick={handleSyncParticipants}
|
||||||
disabled={syncingParticipants || !event || loading}
|
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"
|
class="rounded bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -24,6 +24,11 @@
|
|||||||
let eventsError = $state('');
|
let eventsError = $state('');
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
// Load the persisted event ID from local storage
|
||||||
|
const storedEventId = localStorage.getItem('selectedScannerEventId');
|
||||||
|
if (storedEventId) {
|
||||||
|
selectedEventId = storedEventId;
|
||||||
|
}
|
||||||
await loadEvents();
|
await loadEvents();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -40,9 +45,14 @@
|
|||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
events = eventsData || [];
|
events = eventsData || [];
|
||||||
|
|
||||||
// If there are events, select the first one by default
|
// Check if the previously selected event is still in the list
|
||||||
if (events.length > 0) {
|
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;
|
selectedEventId = events[0].id;
|
||||||
|
} else if (events.length === 0) {
|
||||||
|
selectedEventId = ''; // No events available
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error loading events:', 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
|
// Process a scanned QR code
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (scanned_id === '') return;
|
if (scanned_id === '') return;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p class="text-amber-700 mb-2">This ticket belongs to a different event:</p>
|
<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">
|
<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>
|
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
{ticket_data.scanned_at ? `on ${formatScannedAt(ticket_data.scanned_at)}` : ''}
|
{ticket_data.scanned_at ? `on ${formatScannedAt(ticket_data.scanned_at)}` : ''}
|
||||||
</p>
|
</p>
|
||||||
<div class="bg-white rounded p-3 border border-amber-200 mt-auto">
|
<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>
|
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p class="text-green-700">Ticket successfully validated.</p>
|
<p class="text-green-700">Ticket successfully validated.</p>
|
||||||
<div class="bg-white rounded p-3 border border-green-200 mt-auto">
|
<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>
|
<p>{ticket_data.name || ''} {ticket_data.surname || ''}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
BIN
static/favicon.ico
Normal file
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 |
Reference in New Issue
Block a user