Prettier for Event ID
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
|
||||
if (log_lvl > 1) {
|
||||
console.log(`[event_id] +layout A: ${data.params.event_id}`);
|
||||
if (ae_acct) console.log(`[event_id] +layout B: ${ae_acct.slct.event_id}`);
|
||||
if (ae_acct)
|
||||
console.log(`[event_id] +layout B: ${ae_acct.slct.event_id}`);
|
||||
console.log(`[event_id] +layout C: ${$events_slct.event_id}`);
|
||||
}
|
||||
});
|
||||
@@ -47,11 +48,19 @@
|
||||
$effect(() => {
|
||||
if (ae_acct) {
|
||||
untrack(() => {
|
||||
if (JSON.stringify($events_slct.event_session_obj_li) !== JSON.stringify(ae_acct.slct.event_session_obj_li)) {
|
||||
$events_slct.event_session_obj_li = ae_acct.slct.event_session_obj_li;
|
||||
if (
|
||||
JSON.stringify($events_slct.event_session_obj_li) !==
|
||||
JSON.stringify(ae_acct.slct.event_session_obj_li)
|
||||
) {
|
||||
$events_slct.event_session_obj_li =
|
||||
ae_acct.slct.event_session_obj_li;
|
||||
}
|
||||
if (JSON.stringify($events_slct.event_location_obj_li) !== JSON.stringify(ae_acct.slct.event_location_obj_li)) {
|
||||
$events_slct.event_location_obj_li = ae_acct.slct.event_location_obj_li;
|
||||
if (
|
||||
JSON.stringify($events_slct.event_location_obj_li) !==
|
||||
JSON.stringify(ae_acct.slct.event_location_obj_li)
|
||||
) {
|
||||
$events_slct.event_location_obj_li =
|
||||
ae_acct.slct.event_location_obj_li;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ export async function load({ params, parent }) {
|
||||
let ae_acct = data[account_id];
|
||||
|
||||
if (!ae_acct) {
|
||||
console.warn(`ae Events - [event_id] +layout.ts: Account ${account_id} not found in data. Initializing ghost acct.`);
|
||||
console.warn(
|
||||
`ae Events - [event_id] +layout.ts: Account ${account_id} not found in data. Initializing ghost acct.`
|
||||
);
|
||||
ae_acct = {
|
||||
api: data.ae_api || {},
|
||||
slct: {
|
||||
@@ -39,7 +41,8 @@ export async function load({ params, parent }) {
|
||||
ae_acct.slct.event_id = event_id;
|
||||
|
||||
if (browser) {
|
||||
if (log_lvl) console.log(`ae_events [event_id] +layout.ts (Non-Blocking)`);
|
||||
if (log_lvl)
|
||||
console.log(`ae_events [event_id] +layout.ts (Non-Blocking)`);
|
||||
|
||||
// OPTIMIZATION: Fire the event load in the background without 'await'.
|
||||
// The event module uses SWR, so this will:
|
||||
|
||||
@@ -53,10 +53,12 @@
|
||||
];
|
||||
|
||||
let filtered_modules = $derived(
|
||||
modules.filter(mod => {
|
||||
if (mod.access === 'authenticated_access') return $ae_loc.authenticated_access;
|
||||
modules.filter((mod) => {
|
||||
if (mod.access === 'authenticated_access')
|
||||
return $ae_loc.authenticated_access;
|
||||
if (mod.access === 'trusted_access') return $ae_loc.trusted_access;
|
||||
if (mod.access === 'administrator_access') return $ae_loc.administrator_access;
|
||||
if (mod.access === 'administrator_access')
|
||||
return $ae_loc.administrator_access;
|
||||
return true;
|
||||
})
|
||||
);
|
||||
@@ -68,23 +70,23 @@
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="container mx-auto p-4 space-y-8">
|
||||
<header class="text-center space-y-2">
|
||||
<div class="container mx-auto space-y-8 p-4">
|
||||
<header class="space-y-2 text-center">
|
||||
<h1 class="text-4xl font-bold">
|
||||
{$lq__event_obj?.name ?? 'Event Hub'}
|
||||
</h1>
|
||||
<p class="text-xl opacity-70">
|
||||
Welcome to the event management dashboard. Please select a module to begin.
|
||||
Welcome to the event management dashboard. Please select a module to
|
||||
begin.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4">
|
||||
{#each filtered_modules as mod (mod.path)}
|
||||
<a
|
||||
href="/events/{$events_slct.event_id}/{mod.path}"
|
||||
class="card card-hover p-6 flex flex-col items-center text-center space-y-4 transition-transform hover:scale-105 bg-surface-100 dark:bg-surface-800 border border-surface-200 dark:border-surface-700 shadow-lg"
|
||||
>
|
||||
<div class="p-6 rounded-full {mod.color} text-white text-4xl">
|
||||
class="card card-hover bg-surface-100 dark:bg-surface-800 border-surface-200 dark:border-surface-700 flex flex-col items-center space-y-4 border p-6 text-center shadow-lg transition-transform hover:scale-105">
|
||||
<div class="rounded-full p-6 {mod.color} text-4xl text-white">
|
||||
<mod.icon size="2rem" />
|
||||
</div>
|
||||
<h3 class="text-2xl font-bold">{mod.name}</h3>
|
||||
@@ -94,14 +96,20 @@
|
||||
</div>
|
||||
|
||||
{#if $ae_loc.administrator_access && $ae_loc.edit_mode}
|
||||
<section class="card p-6 preset-tonal-warning border-l-4 border-warning-500 mt-12 shadow-lg">
|
||||
<section
|
||||
class="card preset-tonal-warning border-warning-500 mt-12 border-l-4 p-6 shadow-lg">
|
||||
<div class="flex items-center gap-4">
|
||||
<Wrench size="2rem" class="shrink-0" aria-hidden="true" />
|
||||
<div>
|
||||
<h3 class="text-xl font-bold">Event Admin Settings</h3>
|
||||
<p>You have elevated privileges. Use the menu above to access advanced settings and reports.</p>
|
||||
<p>
|
||||
You have elevated privileges. Use the menu above to
|
||||
access advanced settings and reports.
|
||||
</p>
|
||||
</div>
|
||||
<a href="/events/{$events_slct.event_id}/settings" class="btn ae_btn_warning ml-auto">
|
||||
<a
|
||||
href="/events/{$events_slct.event_id}/settings"
|
||||
class="btn ae_btn_warning ml-auto">
|
||||
Event Settings
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/state';
|
||||
import { goto } from '$app/navigation';
|
||||
import { Lock, Printer, Plus, Upload, FileText, BarChart2 } from '@lucide/svelte';
|
||||
import {
|
||||
Lock,
|
||||
Printer,
|
||||
Plus,
|
||||
Upload,
|
||||
FileText,
|
||||
BarChart2
|
||||
} from '@lucide/svelte';
|
||||
import { liveQuery } from 'dexie';
|
||||
import { db_events, type Event } from '$lib/ae_events/db_events';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -51,11 +58,31 @@
|
||||
event_obj = value;
|
||||
if (event_obj) {
|
||||
tmp_cfg_json_str = JSON.stringify(event_obj.cfg_json, null, 4);
|
||||
tmp_pres_mgmt_json_str = JSON.stringify(event_obj.mod_pres_mgmt_json, null, 4);
|
||||
tmp_badges_json_str = JSON.stringify(event_obj.mod_badges_json, null, 4);
|
||||
tmp_abstracts_json_str = JSON.stringify(event_obj.mod_abstracts_json, null, 4);
|
||||
tmp_exhibits_json_str = JSON.stringify(event_obj.mod_exhibits_json, null, 4);
|
||||
tmp_meetings_json_str = JSON.stringify(event_obj.mod_meetings_json, null, 4);
|
||||
tmp_pres_mgmt_json_str = JSON.stringify(
|
||||
event_obj.mod_pres_mgmt_json,
|
||||
null,
|
||||
4
|
||||
);
|
||||
tmp_badges_json_str = JSON.stringify(
|
||||
event_obj.mod_badges_json,
|
||||
null,
|
||||
4
|
||||
);
|
||||
tmp_abstracts_json_str = JSON.stringify(
|
||||
event_obj.mod_abstracts_json,
|
||||
null,
|
||||
4
|
||||
);
|
||||
tmp_exhibits_json_str = JSON.stringify(
|
||||
event_obj.mod_exhibits_json,
|
||||
null,
|
||||
4
|
||||
);
|
||||
tmp_meetings_json_str = JSON.stringify(
|
||||
event_obj.mod_meetings_json,
|
||||
null,
|
||||
4
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -85,81 +112,74 @@
|
||||
alert('Settings saved successfully!');
|
||||
} catch (error) {
|
||||
console.error('Error saving settings:', error);
|
||||
alert(
|
||||
'Failed to save settings. Please check if the JSON is valid.'
|
||||
);
|
||||
alert('Failed to save settings. Please check if the JSON is valid.');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $ae_loc.administrator_access}
|
||||
|
||||
<h1 class="h1">Event Settings</h1>
|
||||
|
||||
{#if event_obj}
|
||||
<div class="space-y-4">
|
||||
<details class="details" open>
|
||||
<summary class="summary font-bold text-error-500"
|
||||
>Admin Tools</summary
|
||||
>
|
||||
<div class="p-4 space-y-4">
|
||||
<div class="card p-4 border rounded-md text-center">
|
||||
<summary class="summary text-error-500 font-bold"
|
||||
>Admin Tools</summary>
|
||||
<div class="space-y-4 p-4">
|
||||
<div class="card rounded-md border p-4 text-center">
|
||||
<h4 class="h4">Badge Operations</h4>
|
||||
<div class="flex flex-wrap justify-center gap-2 mt-2">
|
||||
<div class="mt-2 flex flex-wrap justify-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
onclick={() => (show_create_badge_modal = true)}
|
||||
>
|
||||
onclick={() =>
|
||||
(show_create_badge_modal = true)}>
|
||||
<Plus size="1em" aria-hidden="true" /> Add New Badge
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary ml-2"
|
||||
onclick={() => (show_upload_badge_modal = true)}
|
||||
>
|
||||
onclick={() =>
|
||||
(show_upload_badge_modal = true)}>
|
||||
<Upload size="1em" aria-hidden="true" /> Upload Badge
|
||||
List
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card p-4 border rounded-md text-center">
|
||||
<div class="card rounded-md border p-4 text-center">
|
||||
<h4 class="h4">Mass Print Options</h4>
|
||||
<div class="flex flex-wrap justify-center gap-2 mt-2">
|
||||
<div class="mt-2 flex flex-wrap justify-center gap-2">
|
||||
<a
|
||||
href={`/events/${event_id}/badges/print_list?printed_status=not_printed`}
|
||||
class="btn preset-filled-secondary"
|
||||
>
|
||||
<Printer size="1em" aria-hidden="true" /> Print All Unprinted
|
||||
class="btn preset-filled-secondary">
|
||||
<Printer size="1em" aria-hidden="true" /> Print All
|
||||
Unprinted
|
||||
</a>
|
||||
<a
|
||||
href={`/events/${event_id}/badges/print_list?badge_type_code=guest&printed_status=not_printed`}
|
||||
class="btn preset-filled-secondary"
|
||||
>
|
||||
class="btn preset-filled-secondary">
|
||||
<Printer size="1em" aria-hidden="true" /> Print Unprinted
|
||||
Guests
|
||||
</a>
|
||||
<a
|
||||
href={`/events/${event_id}/badges/print_list`}
|
||||
class="btn preset-filled-secondary"
|
||||
>
|
||||
class="btn preset-filled-secondary">
|
||||
<Printer size="1em" aria-hidden="true" /> Print All
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap justify-center gap-4 mt-4">
|
||||
<div class="mt-4 flex flex-wrap justify-center gap-4">
|
||||
<a
|
||||
href={`/events/${event_id}/templates`}
|
||||
class="btn btn-tertiary"
|
||||
>
|
||||
<FileText size="1em" aria-hidden="true" /> Manage Badge Templates
|
||||
class="btn btn-tertiary">
|
||||
<FileText size="1em" aria-hidden="true" /> Manage Badge
|
||||
Templates
|
||||
</a>
|
||||
<a
|
||||
href={`/events/${event_id}/badges/stats`}
|
||||
class="btn btn-tertiary"
|
||||
>
|
||||
class="btn btn-tertiary">
|
||||
<BarChart2 size="1em" aria-hidden="true" /> Badge Printing
|
||||
Stats
|
||||
</a>
|
||||
@@ -172,8 +192,8 @@
|
||||
<div class="p-4">
|
||||
<Ae_comp_event_settings_basic_form
|
||||
bind:event_obj
|
||||
onsave={(data: any) => handle_save('basic_fields', data)}
|
||||
/>
|
||||
onsave={(data: any) =>
|
||||
handle_save('basic_fields', data)} />
|
||||
</div>
|
||||
</details>
|
||||
|
||||
@@ -184,19 +204,19 @@
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (cfg_json_view = 'form')}>Form</button
|
||||
>
|
||||
onclick={() => (cfg_json_view = 'form')}
|
||||
>Form</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (cfg_json_view = 'json')}>JSON</button
|
||||
>
|
||||
onclick={() => (cfg_json_view = 'json')}
|
||||
>JSON</button>
|
||||
</div>
|
||||
{#if cfg_json_view === 'form'}
|
||||
<Ae_comp_event_settings_form
|
||||
bind:cfg_json={event_obj.cfg_json}
|
||||
onsave={(data: any) => handle_save('cfg_json', data)}
|
||||
/>
|
||||
onsave={(data: any) =>
|
||||
handle_save('cfg_json', data)} />
|
||||
{:else}
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
readonly={false}
|
||||
@@ -204,44 +224,40 @@
|
||||
bind:new_content={tmp_cfg_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
onclick={() => {
|
||||
handle_save('cfg_json', tmp_cfg_json_str);
|
||||
}}>Save</button
|
||||
>
|
||||
}}>Save</button>
|
||||
{/if}
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="details">
|
||||
<summary class="summary"
|
||||
>Presentation Management (mod_pres_mgmt_json)</summary
|
||||
>
|
||||
>Presentation Management (mod_pres_mgmt_json)</summary>
|
||||
<div class="p-4">
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (pres_mgmt_json_view = 'form')}
|
||||
>Form</button
|
||||
>
|
||||
>Form</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (pres_mgmt_json_view = 'json')}
|
||||
>JSON</button
|
||||
>
|
||||
>JSON</button>
|
||||
</div>
|
||||
{#if pres_mgmt_json_view === 'form'}
|
||||
<Ae_comp_event_settings_pres_mgmt_form
|
||||
bind:mod_pres_mgmt_json={event_obj.mod_pres_mgmt_json}
|
||||
bind:mod_pres_mgmt_json={
|
||||
event_obj.mod_pres_mgmt_json
|
||||
}
|
||||
onsave={(data: any) =>
|
||||
handle_save('mod_pres_mgmt_json', data)}
|
||||
/>
|
||||
handle_save('mod_pres_mgmt_json', data)} />
|
||||
{:else}
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
readonly={false}
|
||||
@@ -249,8 +265,7 @@
|
||||
bind:new_content={tmp_pres_mgmt_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
@@ -259,8 +274,7 @@
|
||||
'mod_pres_mgmt_json',
|
||||
tmp_pres_mgmt_json_str
|
||||
);
|
||||
}}>Save</button
|
||||
>
|
||||
}}>Save</button>
|
||||
{/if}
|
||||
</div>
|
||||
</details>
|
||||
@@ -272,20 +286,19 @@
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (badges_json_view = 'form')}>Form</button
|
||||
>
|
||||
onclick={() => (badges_json_view = 'form')}
|
||||
>Form</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (badges_json_view = 'json')}>JSON</button
|
||||
>
|
||||
onclick={() => (badges_json_view = 'json')}
|
||||
>JSON</button>
|
||||
</div>
|
||||
{#if badges_json_view === 'form'}
|
||||
<Ae_comp_event_settings_badges_form
|
||||
bind:mod_badges_json={event_obj.mod_badges_json}
|
||||
onsave={(data: any) =>
|
||||
handle_save('mod_badges_json', data)}
|
||||
/>
|
||||
handle_save('mod_badges_json', data)} />
|
||||
{:else}
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
readonly={false}
|
||||
@@ -293,8 +306,7 @@
|
||||
bind:new_content={tmp_badges_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
@@ -303,35 +315,34 @@
|
||||
'mod_badges_json',
|
||||
tmp_badges_json_str
|
||||
);
|
||||
}}>Save</button
|
||||
>
|
||||
}}>Save</button>
|
||||
{/if}
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="details">
|
||||
<summary class="summary">Abstracts (mod_abstracts_json)</summary>
|
||||
<summary class="summary"
|
||||
>Abstracts (mod_abstracts_json)</summary>
|
||||
<div class="p-4">
|
||||
<div class="flex justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (abstracts_json_view = 'form')}
|
||||
>Form</button
|
||||
>
|
||||
>Form</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm"
|
||||
onclick={() => (abstracts_json_view = 'json')}
|
||||
>JSON</button
|
||||
>
|
||||
>JSON</button>
|
||||
</div>
|
||||
{#if abstracts_json_view === 'form'}
|
||||
<Ae_comp_event_settings_abstracts_form
|
||||
bind:mod_abstracts_json={event_obj.mod_abstracts_json}
|
||||
bind:mod_abstracts_json={
|
||||
event_obj.mod_abstracts_json
|
||||
}
|
||||
onsave={(data: any) =>
|
||||
handle_save('mod_abstracts_json', data)}
|
||||
/>
|
||||
handle_save('mod_abstracts_json', data)} />
|
||||
{:else}
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
readonly={false}
|
||||
@@ -339,8 +350,7 @@
|
||||
bind:new_content={tmp_abstracts_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
@@ -349,8 +359,7 @@
|
||||
'mod_abstracts_json',
|
||||
tmp_abstracts_json_str
|
||||
);
|
||||
}}>Save</button
|
||||
>
|
||||
}}>Save</button>
|
||||
{/if}
|
||||
</div>
|
||||
</details>
|
||||
@@ -364,8 +373,7 @@
|
||||
bind:new_content={tmp_exhibits_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
@@ -374,8 +382,8 @@
|
||||
'mod_exhibits_json',
|
||||
tmp_exhibits_json_str
|
||||
);
|
||||
}}>Save</button
|
||||
> </div>
|
||||
}}>Save</button>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<details class="details">
|
||||
@@ -387,8 +395,7 @@
|
||||
bind:new_content={tmp_meetings_json_str}
|
||||
show_line_numbers={true}
|
||||
placeholder="JSON config"
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg"
|
||||
/>
|
||||
class_li="p-1 preset-outlined-success-400-600 shadow-lg rounded-lg" />
|
||||
<button
|
||||
type="button"
|
||||
class="btn preset-tonal-primary"
|
||||
@@ -397,8 +404,8 @@
|
||||
'mod_meetings_json',
|
||||
tmp_meetings_json_str
|
||||
);
|
||||
}}>Save</button
|
||||
> </div>
|
||||
}}>Save</button>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{:else}
|
||||
@@ -414,8 +421,7 @@
|
||||
onsuccess={() => {
|
||||
show_create_badge_modal = false;
|
||||
}}
|
||||
oncancel={() => (show_create_badge_modal = false)}
|
||||
/>
|
||||
oncancel={() => (show_create_badge_modal = false)} />
|
||||
</div>
|
||||
</Modal>
|
||||
{/if}
|
||||
@@ -429,20 +435,22 @@
|
||||
onsuccess={() => {
|
||||
show_upload_badge_modal = false;
|
||||
}}
|
||||
oncancel={() => (show_upload_badge_modal = false)}
|
||||
/>
|
||||
oncancel={() => (show_upload_badge_modal = false)} />
|
||||
</div>
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
{:else}
|
||||
<!-- Non-administrator landed here — show a brief message while the onMount redirect fires -->
|
||||
<section class="flex flex-col items-center justify-center grow text-center space-y-4 py-20">
|
||||
<div class="p-6 bg-error-500/10 rounded-full">
|
||||
<section
|
||||
class="flex grow flex-col items-center justify-center space-y-4 py-20 text-center">
|
||||
<div class="bg-error-500/10 rounded-full p-6">
|
||||
<Lock size={64} class="text-error-500" />
|
||||
</div>
|
||||
<h1 class="h1 font-black">Access Restricted</h1>
|
||||
<p class="max-w-md opacity-70">Event settings require administrator access. Redirecting…</p>
|
||||
<a href={`/events/${event_id}`} class="btn preset-filled-primary">Return to Event</a>
|
||||
<p class="max-w-md opacity-70">
|
||||
Event settings require administrator access. Redirecting…
|
||||
</p>
|
||||
<a href={`/events/${event_id}`} class="btn preset-filled-primary"
|
||||
>Return to Event</a>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.name_char_limit}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.name_char_limit} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -32,8 +31,7 @@
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.text_char_limit}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.text_char_limit} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -42,8 +40,7 @@
|
||||
<input
|
||||
type="datetime-local"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.deadline_new}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.deadline_new} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -52,8 +49,7 @@
|
||||
<input
|
||||
type="datetime-local"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.deadline_updates}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.deadline_updates} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -61,8 +57,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_abstracts_json.confirm_email_w_link}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_abstracts_json.confirm_email_w_link
|
||||
} />
|
||||
<span>Confirm Email with Link</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -72,8 +69,7 @@
|
||||
<input
|
||||
type="email"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.confirm_from_email}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.confirm_from_email} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -82,8 +78,7 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.confirm_from_name}
|
||||
/>
|
||||
bind:value={mod_abstracts_json.confirm_from_name} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -92,14 +87,14 @@
|
||||
<input
|
||||
type="email"
|
||||
class="input"
|
||||
bind:value={mod_abstracts_json.confirm_to_email_override}
|
||||
/>
|
||||
bind:value={
|
||||
mod_abstracts_json.confirm_to_email_override
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button
|
||||
>
|
||||
>Save</button>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
|
||||
const all_attendee_fields = [
|
||||
{ key: 'full_name_override', label: 'Full Name (override)' },
|
||||
{ key: 'professional_title_override', label: 'Professional Title (override)' },
|
||||
{
|
||||
key: 'professional_title_override',
|
||||
label: 'Professional Title (override)'
|
||||
},
|
||||
{ key: 'affiliations_override', label: 'Affiliations (override)' },
|
||||
{ key: 'location_override', label: 'Location (override)' }
|
||||
];
|
||||
@@ -43,12 +46,24 @@
|
||||
}
|
||||
if (!mod_badges_json.edit_permissions.authenticated) {
|
||||
mod_badges_json.edit_permissions.authenticated = {
|
||||
can_edit: ['full_name_override', 'professional_title_override', 'affiliations_override', 'location_override']
|
||||
can_edit: [
|
||||
'full_name_override',
|
||||
'professional_title_override',
|
||||
'affiliations_override',
|
||||
'location_override'
|
||||
]
|
||||
};
|
||||
}
|
||||
if (!mod_badges_json.edit_permissions.trusted) {
|
||||
mod_badges_json.edit_permissions.trusted = {
|
||||
can_edit: ['full_name_override', 'professional_title_override', 'affiliations_override', 'location_override', 'email', 'badge_type_code']
|
||||
can_edit: [
|
||||
'full_name_override',
|
||||
'professional_title_override',
|
||||
'affiliations_override',
|
||||
'location_override',
|
||||
'email',
|
||||
'badge_type_code'
|
||||
]
|
||||
};
|
||||
}
|
||||
if (!mod_badges_json.edit_permissions.administrator) {
|
||||
@@ -56,7 +71,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
function is_field_enabled(level: 'authenticated' | 'trusted', field_key: string): boolean {
|
||||
function is_field_enabled(
|
||||
level: 'authenticated' | 'trusted',
|
||||
field_key: string
|
||||
): boolean {
|
||||
const cfg = mod_badges_json?.edit_permissions?.[level]?.can_edit;
|
||||
if (!cfg) return false;
|
||||
if (cfg === '*') return true;
|
||||
@@ -69,9 +87,14 @@
|
||||
let fields: string[] = mod_badges_json.edit_permissions[level].can_edit;
|
||||
if (!Array.isArray(fields)) fields = [];
|
||||
if (fields.includes(field_key)) {
|
||||
mod_badges_json.edit_permissions[level].can_edit = fields.filter((f: string) => f !== field_key);
|
||||
mod_badges_json.edit_permissions[level].can_edit = fields.filter(
|
||||
(f: string) => f !== field_key
|
||||
);
|
||||
} else {
|
||||
mod_badges_json.edit_permissions[level].can_edit = [...fields, field_key];
|
||||
mod_badges_json.edit_permissions[level].can_edit = [
|
||||
...fields,
|
||||
field_key
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +111,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_badges_json.badge_id_only_search}
|
||||
/>
|
||||
bind:checked={mod_badges_json.badge_id_only_search} />
|
||||
<span>Badge ID Only Search</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -98,8 +120,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_badges_json.enable_mass_print}
|
||||
/>
|
||||
bind:checked={mod_badges_json.enable_mass_print} />
|
||||
<span>Enable Mass Print</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -108,8 +129,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_badges_json.enable_add_badge_btn}
|
||||
/>
|
||||
bind:checked={mod_badges_json.enable_add_badge_btn} />
|
||||
<span>Enable Add Badge Button</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -118,8 +138,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_badges_json.enable_upload_badge_li_btn}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_badges_json.enable_upload_badge_li_btn
|
||||
} />
|
||||
<span>Enable Upload Badge List Button</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -128,8 +149,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_badges_json.enable_search_qr}
|
||||
/>
|
||||
bind:checked={mod_badges_json.enable_search_qr} />
|
||||
<span>Enable Search by QR</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -142,8 +162,7 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_badges_json.qr_type}
|
||||
/>
|
||||
bind:value={mod_badges_json.qr_type} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -152,8 +171,7 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_badges_json.trusted_passcode}
|
||||
/>
|
||||
bind:value={mod_badges_json.trusted_passcode} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -162,20 +180,20 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_badges_json.administrator_passcode}
|
||||
/>
|
||||
bind:value={mod_badges_json.administrator_passcode} />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<details class="space-y-3">
|
||||
<summary class="cursor-pointer font-medium text-sm">
|
||||
<summary class="cursor-pointer text-sm font-medium">
|
||||
Badge Review — Editable Field Permissions
|
||||
</summary>
|
||||
<div class="space-y-4 pt-2 pl-2">
|
||||
<p class="text-xs text-gray-500">
|
||||
Controls which fields each access level may edit on the Badge Review page.
|
||||
Staff (Trusted) defaults include all attendee fields plus Email and Badge Type Code.
|
||||
Controls which fields each access level may edit on the
|
||||
Badge Review page. Staff (Trusted) defaults include all
|
||||
attendee fields plus Email and Badge Type Code.
|
||||
Administrators can always edit everything.
|
||||
</p>
|
||||
|
||||
@@ -184,13 +202,20 @@
|
||||
<p class="text-sm font-medium">Attendees (passcode link)</p>
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-1">
|
||||
{#each all_attendee_fields as field (field.key)}
|
||||
<label class="label flex items-center gap-2 text-sm">
|
||||
<label
|
||||
class="label flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
checked={is_field_enabled('authenticated', field.key)}
|
||||
onchange={() => toggle_field('authenticated', field.key)}
|
||||
/>
|
||||
checked={is_field_enabled(
|
||||
'authenticated',
|
||||
field.key
|
||||
)}
|
||||
onchange={() =>
|
||||
toggle_field(
|
||||
'authenticated',
|
||||
field.key
|
||||
)} />
|
||||
<span>{field.label}</span>
|
||||
</label>
|
||||
{/each}
|
||||
@@ -202,13 +227,17 @@
|
||||
<p class="text-sm font-medium">Staff (Trusted access)</p>
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-1">
|
||||
{#each all_staff_fields as field (field.key)}
|
||||
<label class="label flex items-center gap-2 text-sm">
|
||||
<label
|
||||
class="label flex items-center gap-2 text-sm">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
checked={is_field_enabled('trusted', field.key)}
|
||||
onchange={() => toggle_field('trusted', field.key)}
|
||||
/>
|
||||
checked={is_field_enabled(
|
||||
'trusted',
|
||||
field.key
|
||||
)}
|
||||
onchange={() =>
|
||||
toggle_field('trusted', field.key)} />
|
||||
<span>{field.label}</span>
|
||||
</label>
|
||||
{/each}
|
||||
@@ -217,13 +246,14 @@
|
||||
|
||||
<!-- Administrator note -->
|
||||
<p class="text-xs text-gray-400 italic">
|
||||
Administrators always have access to all fields (not configurable).
|
||||
Administrators always have access to all fields (not
|
||||
configurable).
|
||||
</p>
|
||||
</div>
|
||||
</details>
|
||||
{/if} <!-- end {#if mod_badges_json} -->
|
||||
{/if}
|
||||
<!-- end {#if mod_badges_json} -->
|
||||
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button
|
||||
>
|
||||
>Save</button>
|
||||
</div>
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={event_obj.conference}
|
||||
/>
|
||||
bind:checked={event_obj.conference} />
|
||||
<span>Conference</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -62,8 +61,7 @@
|
||||
<input
|
||||
type="datetime-local"
|
||||
class="input"
|
||||
bind:value={event_obj.start_datetime}
|
||||
/>
|
||||
bind:value={event_obj.start_datetime} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -72,8 +70,7 @@
|
||||
<input
|
||||
type="datetime-local"
|
||||
class="input"
|
||||
bind:value={event_obj.end_datetime}
|
||||
/>
|
||||
bind:value={event_obj.end_datetime} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -83,6 +80,5 @@
|
||||
</label>
|
||||
</div>
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button
|
||||
>
|
||||
>Save</button>
|
||||
</div>
|
||||
|
||||
@@ -18,17 +18,22 @@
|
||||
<div>
|
||||
<label class="label">
|
||||
<span>Short Name</span>
|
||||
<input type="text" class="input" bind:value={cfg_json.short_name} />
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={cfg_json.short_name} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<span>Medium Name</span>
|
||||
<input type="text" class="input" bind:value={cfg_json.med_name} />
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={cfg_json.med_name} />
|
||||
</label>
|
||||
</div>
|
||||
{/if}
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button
|
||||
>
|
||||
>Save</button>
|
||||
</div>
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.lock_config}
|
||||
/>
|
||||
bind:checked={mod_pres_mgmt_json.lock_config} />
|
||||
<span>Lock Config</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -31,8 +30,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__location_code}
|
||||
/>
|
||||
bind:checked={mod_pres_mgmt_json.hide__location_code} />
|
||||
<span>Hide Location Code</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -41,8 +39,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__presentation_code}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.hide__presentation_code
|
||||
} />
|
||||
<span>Hide Presentation Code</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -51,8 +50,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__presenter_code}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.hide__presenter_code
|
||||
} />
|
||||
<span>Hide Presenter Code</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -61,8 +61,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__session_code}
|
||||
/>
|
||||
bind:checked={mod_pres_mgmt_json.hide__session_code} />
|
||||
<span>Hide Session Code</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -71,8 +70,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.limit__navigation}
|
||||
/>
|
||||
bind:checked={mod_pres_mgmt_json.limit__navigation} />
|
||||
<span>Limit Navigation</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -81,8 +79,7 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.limit__options}
|
||||
/>
|
||||
bind:checked={mod_pres_mgmt_json.limit__options} />
|
||||
<span>Limit Options</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -91,8 +88,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.require__presenter_agree}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.require__presenter_agree
|
||||
} />
|
||||
<span>Require Presenter Agreement</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -101,8 +99,9 @@
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.require__session_agree}
|
||||
/>
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.require__session_agree
|
||||
} />
|
||||
<span>Require Session Agreement</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -115,8 +114,9 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_pres_mgmt_json.label__person_external_id}
|
||||
/>
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__person_external_id
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -125,8 +125,9 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_pres_mgmt_json.label__session_poc_type}
|
||||
/>
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__session_poc_type
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -135,14 +136,14 @@
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={mod_pres_mgmt_json.label__session_poc_name}
|
||||
/>
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__session_poc_name
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button
|
||||
>
|
||||
>Save</button>
|
||||
</div>
|
||||
|
||||
@@ -115,8 +115,7 @@
|
||||
$events_loc.auth__person.entered_key = $events_sess.auth__entered_key; // need to verify entered_key...
|
||||
|
||||
$events_loc.auth__kv.person[$events_sess.auth__person.person_id] = true;
|
||||
$events_loc.auth__kv.session[$events_sess.auth__person.session_id] =
|
||||
true;
|
||||
$events_loc.auth__kv.session[$events_sess.auth__person.session_id] = true;
|
||||
$events_loc.auth__kv.presentation[
|
||||
$events_sess.auth__person.presentation_id
|
||||
] = false; // Set to false for session POC (LCI Champions).
|
||||
@@ -207,9 +206,8 @@
|
||||
onclick={() => {
|
||||
sign_out();
|
||||
alert('You have been signed out.');
|
||||
}}
|
||||
>
|
||||
<X size="1em" class="inline mx-1" />
|
||||
}}>
|
||||
<X size="1em" class="mx-1 inline" />
|
||||
Sign Out
|
||||
{$lq__auth__event_presenter_obj?.given_name
|
||||
? `- ${$lq__auth__event_presenter_obj?.given_name}`
|
||||
@@ -217,8 +215,7 @@
|
||||
</button>
|
||||
{:else if $events_sess.auth__person.presenter_id || $events_sess.auth__person.session_id}
|
||||
<div
|
||||
class="border border-gray-200 p-2 rounded-md m-2 text-center space-y-2"
|
||||
>
|
||||
class="m-2 space-y-2 rounded-md border border-gray-200 p-2 text-center">
|
||||
<div class="text-sm text-gray-500">
|
||||
Use the link that was sent to your email address to sign in or
|
||||
enter your key and passcode to sign in.
|
||||
@@ -230,19 +227,21 @@
|
||||
placeholder="Key"
|
||||
value={$events_sess.auth__entered_key ?? ''}
|
||||
oninput={(e) =>
|
||||
($events_sess.auth__entered_key = (e.target as HTMLInputElement).value)}
|
||||
/>
|
||||
($events_sess.auth__entered_key = (
|
||||
e.target as HTMLInputElement
|
||||
).value)} />
|
||||
<input
|
||||
type="text"
|
||||
class="input max-w-36"
|
||||
placeholder="Passcode"
|
||||
value={$events_sess.auth__entered_passcode ?? ''}
|
||||
oninput={(e) =>
|
||||
($events_sess.auth__entered_passcode = (e.target as HTMLInputElement).value)}
|
||||
/>
|
||||
($events_sess.auth__entered_passcode = (
|
||||
e.target as HTMLInputElement
|
||||
).value)} />
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-md preset-tonal-primary border border-primary-500"
|
||||
class="btn btn-md preset-tonal-primary border-primary-500 border"
|
||||
onclick={() => {
|
||||
console.log('Sign in with URL values');
|
||||
|
||||
@@ -267,9 +266,8 @@
|
||||
// Setting again here... just because for now.
|
||||
// $events_slct.event_presentation_id = $events_sess.auth__person.presentation_id;
|
||||
// $events_slct.event_presenter_id = $events_sess.auth__person.presenter_id;
|
||||
}}
|
||||
>
|
||||
<LogIn size="1em" class="inline mx-1" />
|
||||
}}>
|
||||
<LogIn size="1em" class="mx-1 inline" />
|
||||
Sign In
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user