diff --git a/src/lib/ae_events_stores.ts b/src/lib/ae_events_stores.ts index ec7ec394..02fe2d76 100644 --- a/src/lib/ae_events_stores.ts +++ b/src/lib/ae_events_stores.ts @@ -174,6 +174,20 @@ let events_session_data_struct: key_val = { 'qry__limit': 20, 'qry__offset': 0, + // This is intended to only be temporary. + auth__person: {}, + auth__entered_key: null, + auth__entered_passcode: null, + auth__kv: { + event: {}, + exhibit: {}, + location: {}, + session: {}, + presentation: {}, + presenter: {}, + person: {}, + }, + // Badge Printing 'badges': { 'fulltext_search_qry_str': null, diff --git a/src/lib/db_events.ts b/src/lib/db_events.ts index 4732295a..bcfd600a 100644 --- a/src/lib/db_events.ts +++ b/src/lib/db_events.ts @@ -300,6 +300,9 @@ export class MySubClassedDexie extends Dexie { badges!: Table; exhibits!: Table; exhibit_tracking!: Table; + sessions!: Table; + presentations!: Table; + presenters!: Table; constructor() { super('ae_events_db'); diff --git a/src/routes/events_pres_mgmt/event/[slug]/+page.svelte b/src/routes/events_pres_mgmt/event/[slug]/+page.svelte index e1b64a2a..a4f145d3 100644 --- a/src/routes/events_pres_mgmt/event/[slug]/+page.svelte +++ b/src/routes/events_pres_mgmt/event/[slug]/+page.svelte @@ -204,7 +204,7 @@ $: if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id)

{$event_obj.name}

{/if} -
+
{ diff --git a/src/routes/events_pres_mgmt/session/[slug]/+page.svelte b/src/routes/events_pres_mgmt/session/[slug]/+page.svelte index 64da7769..a37724e2 100644 --- a/src/routes/events_pres_mgmt/session/[slug]/+page.svelte +++ b/src/routes/events_pres_mgmt/session/[slug]/+page.svelte @@ -36,14 +36,15 @@ $events_slct.event_obj = ae_acct.slct.event_obj; $events_slct.event_session_id = ae_acct.slct.event_session_id; $events_slct.event_session_obj = ae_acct.slct.event_session_obj; $events_slct.event_presentation_obj_li = ae_acct.slct.event_presentation_obj_li; +// $events_slct.event_file_obj_li = ae_acct.slct.event_file_obj_li; if (!$events_loc.auth__person) { $events_loc.auth__person = { - id: '', - email: '', - full_name: '', - entered_key: '', - entered_passcode: '', + id: null, + email: null, + full_name: null, + entered_key: null, + entered_passcode: null, }; } @@ -83,14 +84,22 @@ let event_obj = liveQuery( let event_obj_v2 = db_events.events.get($events_slct.event_id); -let event_session_obj = liveQuery( +let lq__event_session_obj = liveQuery( () => db_events.sessions.get($events_slct.event_session_id) ); -let event_presentation_obj_li = liveQuery( +let lq__event_presentation_obj_li = liveQuery( () => db_events.presentations.where('event_session_id_random').equals($events_slct.event_session_id_random).toArray() ); +let lq__event_presentation_obj = liveQuery( + () => db_events.presentations.get($events_slct.event_presentation_id) +); + +let lq__event_presenter_obj = liveQuery( + () => db_events.presenters.get($events_slct.event_presenter_id) +); + // Load the Event Obj with ID based on the slug param. // $events_slct.event_id = param_slug_event_id; // console.log('Selected Event ID:', $events_slct.event_id); @@ -127,22 +136,57 @@ onMount(() => { // console.log(`ae_events_pres_mgmt presenter [slug] +page.svelte data:`, data); - if (!$events_slct.event_id) { - console.log(`No ID! Nothing to show. Try setting the ID again.`); - $events_slct.event_id = $events_slct.event_id; - } - if (!$events_slct.event_session_id) { - console.log(`No Session ID! Nothing to show. Try setting the Session ID again.`); - $events_slct.event_session_id = $events_slct.event_session_id; - } + // if (!$events_slct.event_id) { + // console.log(`No ID! Nothing to show. Try setting the ID again.`); + // $events_slct.event_id = $events_slct.event_id; + // } + // if (!$events_slct.event_session_id) { + // console.log(`No Session ID! Nothing to show. Try setting the Session ID again.`); + // $events_slct.event_session_id = $events_slct.event_session_id; + // } let url_person_id = data.url.searchParams.get('person_id'); let url_person_pass = data.url.searchParams.get('person_pass'); - if (url_person_pass) { - console.log(`ae_events_pres_mgmt session [slug] +page.svelte: event_session_id=${$events_slct.session_id}; person_id=${url_person_id}; person_pass=${url_person_pass}`); + let url_presentation_id = data.url.searchParams.get('presentation_id'); + let url_presenter_id = data.url.searchParams.get('presenter_id'); + + // This should be turned into a function to correctly authenticate the person and allow them access to their presentations and presenter details. + if (url_person_pass) { + console.log(`ae_events_pres_mgmt session [slug] +page.svelte: event_session_id=${$events_slct.session_id}; person_id=${url_person_id}; person_pass=${url_person_pass}; presentation_id=${url_presentation_id}; presenter_id=${url_presenter_id}`); + + // Using temporary session values first. + $events_sess.auth__entered_key = url_person_id; + $events_sess.auth__entered_passcode = url_person_pass; + + $events_sess.auth__person.id = url_person_id; + $events_sess.auth__person.presentation_id = url_presentation_id; + $events_sess.auth__person.presenter_id = url_presenter_id; + + $events_sess.auth__kv.person[url_person_id] = true; + // $events_sess.auth__kv.session[$events_slct.event_session_id] = true; + $events_sess.auth__kv.presentation[url_presentation_id] = true; + $events_sess.auth__kv.presenter[url_presenter_id] = true; + + // We need to set the selected presentation and presenter objects based on the respective IDs. + if (url_presentation_id && url_presenter_id) { + $events_slct.event_presentation_id = url_presentation_id; + $events_slct.event_presenter_id = url_presenter_id; + } + + // // We need to load the presentation and presenter objects based on the IDs. + // if ($events_slct.event_presentation_obj_li && $events_slct.event_presentation_obj_li.length > 0) { + // let event_presentation_obj = $events_slct.event_presentation_obj_li.find((obj) => obj.event_presentation_id_random == url_presentation_id); + // $events_slct.presentation_obj = event_presentation_obj; + // if (event_presentation_obj.event_presenter_li && event_presentation_obj.event_presenter_li.length > 0) { + // let event_presenter_obj = event_presentation_obj.event_presenter_li.find((obj) => obj.event_presenter_id_random == url_presenter_id); + // $events_slct.presenter_obj = event_presenter_obj; + + // } + // } + + // // events_func.handle_load_ae_obj_id__presentation({api_cfg: $ae_api, presentation_id: url_presentation_id}); + // } - $events_sess.entered_key = url_person_id; - $events_sess.entered_passcode = url_person_pass; // console.log('Remove the passcode from the URL.'); // data.url.searchParams.delete('person_id'); @@ -167,9 +211,9 @@ onMount(() => { > -{#if $events_slct.event_session_id && $event_session_obj} +{#if $events_slct.event_session_id && $lq__event_session_obj} -

{$event_session_obj.name}

+

{$lq__event_session_obj.name}

@@ -179,23 +223,23 @@ onMount(() => { class="space-y-2 px-4" >
  • - Name/Title: {$event_session_obj.name} + Name/Title: {$lq__event_session_obj.name} - {$event_session_obj.code} + {$lq__event_session_obj.code}
  • - Date time: {ae_util.iso_datetime_formatter($event_session_obj.start_datetime, 'datetime_long')} - {ae_util.iso_datetime_formatter($event_session_obj.end_datetime, 'datetime_long')} + Date time: {ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'datetime_long')} - {ae_util.iso_datetime_formatter($lq__event_session_obj.end_datetime, 'datetime_long')}
  • - Location/Room: {$event_session_obj.event_location_name ? $event_session_obj.event_location_name : '-- not set --'} + Location/Room: {$lq__event_session_obj.event_location_name ? $lq__event_session_obj.event_location_name : '-- not set --'}
  • {#if $ae_loc.trusted_access}
  • - Session passcode: {$event_session_obj.passcode ? $event_session_obj.passcode : '-- not set --'} + Session passcode: {$lq__event_session_obj.passcode ? $lq__event_session_obj.passcode : '-- not set --'}
  • {/if} @@ -225,7 +269,7 @@ onMount(() => {
    {$event_session_obj.description}
    + >{$lq__event_session_obj.description} @@ -238,13 +282,13 @@ onMount(() => { cols="30" rows="4" disabled - >{$event_session_obj.description} + >{$lq__event_session_obj.description} -->
    {#if $ae_loc.trusted_access || $events_loc.auth__kv.session[$events_slct.event_session_id]} - {#if $events_slct.presenter_obj.agree} + {#if $ae_loc.trusted_access || ($events_loc.auth__kv.presenter[$events_slct.event_presenter_id] && $lq__event_presenter_obj?.agree)} { LCI Speaker and Champion Congress Task List (Excel) {:else} - +

    Read and Consent Agreement?

    -

    - Please select your name below to view, read, and consent the agreement. -

    + +

    Please select your name below to view, read, and consent the agreement.

    + +

    You will be able to download the LCI Congress Template 2024 (PowerPoint) and LCI Speaker and Champion Congress Task List (Excel) after you have read and consented to the agreement.

    {/if} + {#if $events_loc.auth__person?.id} + {/if} {:else} -
    -

    Restricted access!

    -

    - Please select your name below to email the access link. - The email address associated with your LCI member record will be used. - This is not shown below for safety reasons. - -

    +
    +

    Restricted access!

    +

    + Please select your name below to email the access link. + The email address associated with your LCI member record will be used. + The email address is not shown below for safety reasons. + +

    -
    +
    - Use the link that was sent to your email address to sign in or enter your key and passcode to sign in. + Use the link that was sent to your email address to sign in or enter your key and passcode to sign in.
    -
    -
    +
    $events_sess.entered_key = e.target.value} + value={$events_sess.auth__entered_key ?? ''} + on:input={(e) => $events_sess.auth__entered_key = e.target.value} > $events_sess.entered_passcode = e.target.value} + value={$events_sess.auth__entered_passcode ?? ''} + on:input={(e) => $events_sess.auth__entered_passcode = e.target.value} > -
    - - -
    +
    + For: presentation: {$events_sess.auth__person.presentation_id} presenter: {$events_sess.auth__person.presenter_id} +
    + + {$lq__event_presentation_obj?.name ? `Name: "${$lq__event_presentation_obj.name}"` : '-- not set --'} +
    + + + {#if $events_loc.auth__person?.id} + + {/if}
    - {/if}
    @@ -454,6 +512,7 @@ onMount(() => { class:hidden={$events_loc.pres_mgmt.show_content__presentation_description !== event_presentation_obj.event_presentation_id_random} >{event_presentation_obj.description} + {#await event_presentation_obj.event_presenter_li}

    Loading...

    {:then event_presenter_li} @@ -464,34 +523,55 @@ onMount(() => { > {#each event_presenter_li as event_presenter_obj}
  • - {#if event_presenter_obj.agree} - - {:else} + } + class="btn btn-lg variant-ghost-primary text-lg font-bold min-w-56" + title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.email}" + > + + {event_presenter_obj.full_name} + + + + + {#if $ae_loc.trusted_access || !$events_loc.auth__person.id } + + {/if} + + + {#if event_presenter_obj.agree} + + {:else} + {/if} - - - - {event_presenter_obj.full_name} - {#if $ae_loc.trusted_access && event_presenter_obj.email} @@ -549,34 +645,23 @@ onMount(() => { {/if} {:else} - {/if} + + + {#if $ae_loc.trusted_access} + {/if} + {#await event_presentation_obj.event_file_li} +

    Loading...

    + {:then event_file_li} + {#if event_file_li} + Files: + + {/if} + {:catch error} +

    Error: {error.message}

    + {/await} +
  • {/each}