From 476b303da4ec646967d218e06641d474a58c7620 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 24 Sep 2024 16:55:23 -0400 Subject: [PATCH] Lots of work on the new Launcher. Also general reorganizing of files. --- src/lib/ae_events__event_location.ts | 18 +- src/lib/ae_events__event_session.ts | 13 +- .../[event_id]/(launcher)/+layout.svelte | 231 +++++++ .../events/[event_id]/(launcher)/+layout.ts | 78 +++ .../(launcher)/launcher/+page.svelte | 6 + .../[event_id]/(launcher)/launcher/+page.ts} | 0 .../launcher/[event_location_id]/+page.svelte | 249 ++++++++ .../launcher/[event_location_id]/+page.ts | 143 +++++ .../(launcher)}/launcher_file_cont.svelte | 0 .../(launcher)}/launcher_menu.svelte | 83 ++- .../launcher_presenter_view.svelte | 0 .../(launcher)}/launcher_session_view.svelte | 38 +- .../(launcher)}/menu_session_list.svelte | 30 +- src/routes/events/[event_id]/+page.svelte | 586 ++++++++++++++++++ src/routes/events/[event_id]/+page.ts | 76 +++ .../events/[event_id]/event_page_menu.svelte | 451 ++++++++++++++ .../events/ae_comp__events_menu_nav.svelte | 67 ++ .../events/ae_comp__events_menu_opts.svelte | 207 +++++++ .../(launcher)/+layout.svelte | 25 - .../(launcher)/launcher/[slug]/+page.ts | 130 ---- .../launcher/[slug]/+page@(launcher).svelte | 462 -------------- .../events_pres_mgmt/event/[slug]/+page.ts | 4 +- .../events_pres_mgmt/session_view.svelte | 8 +- 23 files changed, 2221 insertions(+), 684 deletions(-) create mode 100644 src/routes/events/[event_id]/(launcher)/+layout.svelte create mode 100644 src/routes/events/[event_id]/(launcher)/+layout.ts create mode 100644 src/routes/events/[event_id]/(launcher)/launcher/+page.svelte rename src/routes/{events_pres_mgmt/(launcher)/+layout.ts => events/[event_id]/(launcher)/launcher/+page.ts} (100%) create mode 100644 src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte create mode 100644 src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.ts rename src/routes/{events_pres_mgmt/(launcher)/launcher/[slug] => events/[event_id]/(launcher)}/launcher_file_cont.svelte (100%) rename src/routes/{events_pres_mgmt/(launcher)/launcher/[slug] => events/[event_id]/(launcher)}/launcher_menu.svelte (69%) rename src/routes/{events_pres_mgmt/(launcher)/launcher/[slug] => events/[event_id]/(launcher)}/launcher_presenter_view.svelte (100%) rename src/routes/{events_pres_mgmt/(launcher)/launcher/[slug] => events/[event_id]/(launcher)}/launcher_session_view.svelte (95%) rename src/routes/{events_pres_mgmt/(launcher)/launcher/[slug] => events/[event_id]/(launcher)}/menu_session_list.svelte (86%) create mode 100644 src/routes/events/[event_id]/+page.svelte create mode 100644 src/routes/events/[event_id]/+page.ts create mode 100644 src/routes/events/[event_id]/event_page_menu.svelte create mode 100644 src/routes/events/ae_comp__events_menu_nav.svelte create mode 100644 src/routes/events/ae_comp__events_menu_opts.svelte delete mode 100644 src/routes/events_pres_mgmt/(launcher)/+layout.svelte delete mode 100644 src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page.ts delete mode 100644 src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page@(launcher).svelte diff --git a/src/lib/ae_events__event_location.ts b/src/lib/ae_events__event_location.ts index 32c88a6d..1f36fc8e 100644 --- a/src/lib/ae_events__event_location.ts +++ b/src/lib/ae_events__event_location.ts @@ -129,27 +129,31 @@ export async function load_ae_obj_id__event_location( } -// Updated 2024-05-24 +// Updated 2024-09-24 export async function load_ae_obj_li__event_location( { api_cfg, - event_id, + for_obj_type, + for_obj_id, inc_file_li = false, inc_session_li = false, + order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'}, params = {}, try_cache = true, log_lvl = 0 }: { api_cfg: any, - event_id: string, + for_obj_type: string, + for_obj_id: string, inc_file_li?: boolean, inc_session_li?: boolean, + order_by_li?: key_val, params?: key_val, try_cache?: boolean, log_lvl?: number } ) { - console.log(`*** load_ae_obj_li__event_location() *** event_id=${event_id}`); + console.log(`*** load_ae_obj_li__event_location() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`); let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled let hidden: string = (params.qry__hidden ?? 'all'); // all, hidden, not_hidden @@ -163,13 +167,13 @@ export async function load_ae_obj_li__event_location( ae_promises.load__event_location_obj_li = await api.get_ae_obj_li_for_obj_id_crud({ api_cfg: api_cfg, obj_type: 'event_location', - for_obj_type: 'event', - for_obj_id: event_id, + for_obj_type: for_obj_type, + for_obj_id: for_obj_id, use_alt_table: true, // NOTE: This will use the table_name_alt value instead of the table_name value in the API config. use_alt_base: false, // NOTE: This will use the base_name_alt value instead of the base_name value enabled: enabled, hidden: hidden, - order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'name': 'ASC', 'code': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'}, + order_by_li: order_by_li, limit: limit, offset: offset, params_json: params_json, diff --git a/src/lib/ae_events__event_session.ts b/src/lib/ae_events__event_session.ts index 9360fcbe..1e49cb28 100644 --- a/src/lib/ae_events__event_session.ts +++ b/src/lib/ae_events__event_session.ts @@ -16,6 +16,7 @@ export async function load_ae_obj_id__event_session( event_session_id, inc_file_li = false, inc_presentation_li = false, + inc_presenter_li = false, try_cache = true, log_lvl = 0 }: { @@ -23,6 +24,7 @@ export async function load_ae_obj_id__event_session( event_session_id: string, inc_file_li?: boolean, inc_presentation_li?: boolean, + inc_presenter_li?: boolean, try_cache?: boolean, log_lvl?: number } @@ -97,7 +99,10 @@ export async function load_ae_obj_id__event_session( } let load_event_presentation_obj_li = load_ae_obj_li__event_presentation({ api_cfg: api_cfg, - event_session_id: event_session_id, + for_obj_type: 'event_session', + for_obj_id: event_session_id, + inc_file_li: inc_file_li, + inc_presenter_li: inc_presenter_li, params: {qry__enabled: 'all', qry__limit: 25}, try_cache: try_cache, log_lvl: log_lvl @@ -136,6 +141,7 @@ export async function load_ae_obj_li__event_session( for_obj_id, inc_file_li = false, inc_presentation_li = false, + inc_presenter_li = false, order_by_li = {'priority': 'DESC', 'sort': 'DESC', 'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'}, params = {}, try_cache = true, @@ -146,6 +152,7 @@ export async function load_ae_obj_li__event_session( for_obj_id: string, inc_file_li?: boolean, inc_presentation_li?: boolean, + inc_presenter_li?: boolean, order_by_li?: key_val, params?: key_val, try_cache?: boolean, @@ -243,8 +250,8 @@ export async function load_ae_obj_li__event_session( api_cfg: api_cfg, for_obj_type: 'event_session', for_obj_id: event_session_id, - inc_file_li: false, // This will need to be changed. - inc_presenter_li: false, // This will need to be changed. + inc_file_li: inc_file_li, + inc_presenter_li: inc_presenter_li, params: {qry__enabled: 'all', qry__limit: 25}, try_cache: try_cache, log_lvl: log_lvl diff --git a/src/routes/events/[event_id]/(launcher)/+layout.svelte b/src/routes/events/[event_id]/(launcher)/+layout.svelte new file mode 100644 index 00000000..a30423cf --- /dev/null +++ b/src/routes/events/[event_id]/(launcher)/+layout.svelte @@ -0,0 +1,231 @@ + + + + + + + Launcher: + {ae_util.shorten_string({ string: $lq__event_obj?.name ?? '', max_length: 20, begin_length: 10, end_length: 4 })} + ({$lq__event_obj?.event_id ?? 'loading...'}) - Pres Mgmt - {$ae_loc?.title} + + + +{#if !$lq__event_obj} +
+ + Loading... +
+{:else} +
+

Æ Presentation Launcher

+

{$lq__event_obj?.name}

+

{$lq__event_location_obj?.name} + {$events_slct.event_location_id} +

+
+{/if} + + + + + +
+ + + +
+ + + + {#if !$events_slct.event_location_id} +
+ + You must select a location first + +
+ {/if} + + {#if $events_slct.event_session_id && $lq__event_session_obj} + + + {/if} +
+ +
+ + + diff --git a/src/routes/events/[event_id]/(launcher)/+layout.ts b/src/routes/events/[event_id]/(launcher)/+layout.ts new file mode 100644 index 00000000..173acd00 --- /dev/null +++ b/src/routes/events/[event_id]/(launcher)/+layout.ts @@ -0,0 +1,78 @@ +/** @type {import('./$types').LayoutLoad} */ +console.log(`Events - [event_id] launcher +layout.ts start`); + +import { error } from '@sveltejs/kit'; +import { browser } from '$app/environment'; +import { events_func } from '$lib/ae_events_functions'; + +export async function load({ params, parent }) { // route + let log_lvl = 0; + + let data = await parent(); + // console.log(`ae events_pres_mgmt event [event_id] +page.ts data:`, data); + data.log_lvl = log_lvl; + + let account_id = data.account_id; + let ae_acct = data[account_id]; + // console.log(`ae_acct = `, ae_acct); + + // if (!account_id) { + // console.log(`events_pres_mgmt_event [event_id] +page.ts: The account_id was not found in the data!!!`); + // return false; + // } + + // data.ae_events_pres_mgmt_event_event_id_page_ts = true; + + let event_id = params.event_id; + if (!event_id) { + console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`); + error(404, { + message: 'Event ID not found' + }); + } + + // ae_acct.slct.event_id = event_id; + + // let load_event_obj = events_func.handle_load_ae_obj_id__event({ + // api_cfg: ae_acct.api, event_id: event_id, try_cache: true + // }); + + // ae_acct.slct.event_obj = await load_event_obj; + + if (browser) { + console.log(`BROWSER Events - [event_id] launcher +layout.ts start`); + + let load_event_obj = events_func.handle_load_ae_obj_id__event({ + api_cfg: ae_acct.api, event_id: event_id, try_cache: true + }); + console.log(`load_event_obj = `, load_event_obj); + ae_acct.slct.event_obj = load_event_obj; + + // let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({ + // api_cfg: ae_acct.api, + // for_obj_type: 'event', + // for_obj_id: event_id, + // params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, + // try_cache: true, + // log_lvl: 1 + // }); + // console.log(`load_event_session_obj_li = `, load_event_session_obj_li); + // ae_acct.slct.event_session_obj_li = load_event_session_obj_li; + + let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({ + api_cfg: ae_acct.api, + for_obj_type: 'event', + for_obj_id: event_id, + params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, + try_cache: true, + log_lvl: 1 + }); + console.log(`load_event_location_obj_li = `, load_event_location_obj_li); + ae_acct.slct.event_location_obj_li = load_event_location_obj_li; + } + + // WARNING: Precaution against shared data between sites and sessions. + data[account_id] = ae_acct; + + return data; +} diff --git a/src/routes/events/[event_id]/(launcher)/launcher/+page.svelte b/src/routes/events/[event_id]/(launcher)/launcher/+page.svelte new file mode 100644 index 00000000..a04e0228 --- /dev/null +++ b/src/routes/events/[event_id]/(launcher)/launcher/+page.svelte @@ -0,0 +1,6 @@ + + +A location is required \ No newline at end of file diff --git a/src/routes/events_pres_mgmt/(launcher)/+layout.ts b/src/routes/events/[event_id]/(launcher)/launcher/+page.ts similarity index 100% rename from src/routes/events_pres_mgmt/(launcher)/+layout.ts rename to src/routes/events/[event_id]/(launcher)/launcher/+page.ts diff --git a/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte new file mode 100644 index 00000000..bf73ce5d --- /dev/null +++ b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.svelte @@ -0,0 +1,249 @@ + + diff --git a/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.ts b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.ts new file mode 100644 index 00000000..18379a8c --- /dev/null +++ b/src/routes/events/[event_id]/(launcher)/launcher/[event_location_id]/+page.ts @@ -0,0 +1,143 @@ +/** @type {import('./$types').PageLoad} */ +import { error } from '@sveltejs/kit'; +console.log(`ae events launcher [event_location_id] +page.ts: start`); + +import { browser } from '$app/environment'; +import { events_func } from '$lib/ae_events_functions'; + +export async function load({ params, parent, url }) { // route + let log_lvl = 0; + + let data = await parent(); + // console.log(`ae events_pres_mgmt event [event_location_id] +page.ts data:`, data); + data.log_lvl = log_lvl; + + let account_id = data.account_id; + let ae_acct = data[account_id]; + console.log(`ae_acct = `, ae_acct); + + // if (!account_id) { + // console.log(`ae pres_mgmt launcher [event_location_id] +page.ts: The account_id was not found in the data!!!`); + // error(404, { + // message: 'Account ID not found' + // }); + // } + + let event_id = params.event_id; + if (!event_id) { + console.log(`ae Events - [event_id] launcher [event_location_id] +page.ts: The event_id was not found in the params.event_id!!!`); + error(404, { + message: 'Event ID not found' + }); + } + console.log(`event_id = `, event_id); + + // ae_acct.trig = {}; + + // if (ae_acct.slct.event_id !== event_id) { + // ae_acct.slct.event_id = event_id; + // ae_acct.trig.event_id = true; + + // // let load_event_obj = events_func.handle_load_ae_obj_id__event({ + // // api_cfg: ae_acct.api, + // // event_id: event_id, + // // try_cache: false + // // }); + + // // ae_acct.slct.event_obj = await load_event_obj; + // } + + let event_location_id = params.event_location_id; + if (!event_location_id) { + console.log(`ae Events - [event_id] launcher [event_location_id] +page.ts: The event_location_id was not found in the params.event_location_id!!!`); + error(404, { + message: 'Event Location ID not found' + }); + } + console.log(`event_location_id = `, event_location_id); + + // if (browser) { + // ae_acct.trig.event_location_obj_li = false; + // let load_event_location_obj_li = await events_func.load_ae_obj_li__event_location({ + // api_cfg: ae_acct.api, + // event_id: event_id, + // inc_file_li: true, + // params: {qry__enabled: 'enabled', qry__limit: 550}, + // try_cache: true + // }) + // .finally(() => { + // // console.log(`load_event_location_obj_li = `, load_event_location_obj_li); + // ae_acct.trig.event_location_obj_li = true; + // }); + // ae_acct.slct.event_location_obj_li = load_event_location_obj_li; + // // console.log(`ae_acct.slct.event_location_obj_li = `, ae_acct.slct.event_location_obj_li); + + // let id_li__event_location = []; + + // let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery. + + // for (let i = 0; i < load_event_location_obj_li.length; i++) { + // let event_location_obj = load_event_location_obj_li[i]; + // let event_location_id_random = event_location_obj.event_location_id_random; + // tmp_li.push(event_location_id_random); + // } + // id_li__event_location = tmp_li; + // console.log(`id_li__event_location:`, id_li__event_location); + // ae_acct.slct.id_li__event_location = id_li__event_location; + // } + + // let for_obj_type = 'event'; + // let for_obj_id = event_id; + + // ae_acct.trig.event_session_obj_li = true; + + + if (browser) { + console.log('HERE!!!'); + // if (url.searchParams.get('location_id')) { + // console.log(`url.searchParams.get('location_id') = `, url.searchParams.get('location_id')); + // for_obj_type = 'event_location'; + // for_obj_id = url.searchParams.get('location_id'); + // } + + let for_obj_type = 'event_location'; + let for_obj_id = event_location_id; + + // ae_acct.trig.event_session_obj_li = false; + let load_event_session_obj_li = await events_func.load_ae_obj_li__event_session({ + api_cfg: ae_acct.api, + for_obj_type: for_obj_type, + for_obj_id: for_obj_id, + // inc_file_li: false, + // inc_presentation_li: false, + params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 150}, + try_cache: true + }) + .finally(() => { + // console.log(`load_event_session_obj_li = `, load_event_session_obj_li); + // ae_acct.trig.event_session_obj_li = false; + }); + ae_acct.slct.event_session_obj_li = load_event_session_obj_li; + // console.log(`ae_acct.slct.event_session_obj_li = `, ae_acct.slct.event_session_obj_li); + + let id_li__event_session = []; + + let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery. + + for (let i = 0; i < load_event_session_obj_li.length; i++) { + let event_session_obj = load_event_session_obj_li[i]; + let event_session_id_random = event_session_obj.event_session_id_random; + tmp_li.push(event_session_id_random); + } + id_li__event_session = tmp_li; + console.log(`id_li__event_session:`, id_li__event_session); + ae_acct.slct.id_li__event_session = id_li__event_session; + } else { + console.log(`ae pres_mgmt launcher [slug] +page.ts: browser = false`); + } + + // WARNING: Precaution against shared data between sites and sessions. + data[account_id] = ae_acct; + + return data; +} diff --git a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/launcher_file_cont.svelte b/src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte similarity index 100% rename from src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/launcher_file_cont.svelte rename to src/routes/events/[event_id]/(launcher)/launcher_file_cont.svelte diff --git a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/launcher_menu.svelte b/src/routes/events/[event_id]/(launcher)/launcher_menu.svelte similarity index 69% rename from src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/launcher_menu.svelte rename to src/routes/events/[event_id]/(launcher)/launcher_menu.svelte index b171c430..194b2bad 100644 --- a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/launcher_menu.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher_menu.svelte @@ -1,5 +1,6 @@ + + + + + Event: {ae_util.shorten_string({string: $lq__event_obj?.name, max_length: 12})} + ({$lq__event_obj?.event_id}) - Pres Mgmt - {$events_loc?.title} + + + + +
+ + + + + +{#if !$events_loc.pres_mgmt.show_content__event_view || $events_loc.pres_mgmt.show_content__event_view == 'default'} + + +
+

{$lq__event_obj?.name}

+

Presentations - Session Lookup

+
+ + + +
+ +
{ + $events_trigger = 'load__event_session_obj_li'; + }} + autocomplete="off" + class="form flex-grow flex flex-row flex-wrap gap-1 justify-center items-center w-full" + > + + + + + + + + + + { + if ($events_sess.pres_mgmt?.fulltext_search_qry_str && $events_sess.pres_mgmt.fulltext_search_qry_str.length >= 3) { + $events_trigger = 'load__event_session_obj_li'; + } + }} + autofocus + suggest="off" + data-ignore="true" + /> + + +
+ +
+ + + + + + + +{#if $lq__event_session_obj_li && $lq__event_session_obj_li?.length > 0 && event_session_id_random_li && event_session_id_random_li?.length > 0} + + + + +{:else} +
+
+ + No results to show + +
+
+ Please use the search above to find your session. +
+
+
+ Search by: +
    +
  • Session name
  • +
  • Session description
  • +
  • Presentation name
  • +
  • Presenter names
  • +
  • Presenter ID (member ID)
  • +
+
+
+{/if} + + +{:else if $events_loc.pres_mgmt.show_content__event_view == 'manage_files' && $ae_loc.trusted_access} + + + {#if $lq__event_obj} +
+

{$lq__event_obj?.name}

+

Event - Manage Files

+
+ {/if} + +
+

+ + + Manage and Upload Event Files: +

+ + + +
+ + Upload global event files only! +
+ + Global event files only
+ Recommended: PowerPoint (pptx) or Keynote (key)
+ Media: Audio and videos files should be directly embedded in PowerPoint (PPTX) files
+ Supplemental files: mp4, PDF, Word Doc, Excel, txt, etc +
+
+
+ +
+ +
+
+ +{/if} +
+ + + diff --git a/src/routes/events/[event_id]/+page.ts b/src/routes/events/[event_id]/+page.ts new file mode 100644 index 00000000..32cebfa9 --- /dev/null +++ b/src/routes/events/[event_id]/+page.ts @@ -0,0 +1,76 @@ +/** @type {import('./$types').PageLoad} */ +console.log(`Events - [event_id] +page.ts start`); + +import { error } from '@sveltejs/kit'; +import { browser } from '$app/environment'; +import { events_func } from '$lib/ae_events_functions'; + +export async function load({ params, parent }) { // route + let log_lvl = 0; + + let data = await parent(); + // console.log(`ae events_pres_mgmt event [event_id] +page.ts data:`, data); + data.log_lvl = log_lvl; + + let account_id = data.account_id; + let ae_acct = data[account_id]; + // console.log(`ae_acct = `, ae_acct); + + // if (!account_id) { + // console.log(`events_pres_mgmt_event [event_id] +page.ts: The account_id was not found in the data!!!`); + // return false; + // } + + // data.ae_events_pres_mgmt_event_event_id_page_ts = true; + + let event_id = params.event_id; + if (!event_id) { + console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`); + error(404, { + message: 'Event ID not found' + }); + } + + // ae_acct.slct.event_id = event_id; + + // let load_event_obj = events_func.handle_load_ae_obj_id__event({ + // api_cfg: ae_acct.api, event_id: event_id, try_cache: true + // }); + + // ae_acct.slct.event_obj = await load_event_obj; + + if (browser) { + let load_event_obj = events_func.handle_load_ae_obj_id__event({ + api_cfg: ae_acct.api, event_id: event_id, try_cache: true + }); + console.log(`load_event_obj = `, load_event_obj); + ae_acct.slct.event_obj = load_event_obj; + + let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({ + api_cfg: ae_acct.api, + for_obj_type: 'event', + for_obj_id: event_id, + params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, + try_cache: true, + log_lvl: 1 + }); + console.log(`load_event_session_obj_li = `, load_event_session_obj_li); + ae_acct.slct.event_session_obj_li = load_event_session_obj_li; + + let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({ + api_cfg: ae_acct.api, + for_obj_type: 'event', + for_obj_id: event_id, + params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, + try_cache: true, + log_lvl: 1 + }); + console.log(`load_event_location_obj_li = `, load_event_location_obj_li); + ae_acct.slct.event_location_obj_li = load_event_location_obj_li; + } + + // WARNING: Precaution against shared data between sites and sessions. + data[account_id] = ae_acct; + + return data; +} diff --git a/src/routes/events/[event_id]/event_page_menu.svelte b/src/routes/events/[event_id]/event_page_menu.svelte new file mode 100644 index 00000000..e5b5e701 --- /dev/null +++ b/src/routes/events/[event_id]/event_page_menu.svelte @@ -0,0 +1,451 @@ + + + + + diff --git a/src/routes/events/ae_comp__events_menu_nav.svelte b/src/routes/events/ae_comp__events_menu_nav.svelte new file mode 100644 index 00000000..2fd2abe1 --- /dev/null +++ b/src/routes/events/ae_comp__events_menu_nav.svelte @@ -0,0 +1,67 @@ + + + + + \ No newline at end of file diff --git a/src/routes/events/ae_comp__events_menu_opts.svelte b/src/routes/events/ae_comp__events_menu_opts.svelte new file mode 100644 index 00000000..6f7ed745 --- /dev/null +++ b/src/routes/events/ae_comp__events_menu_opts.svelte @@ -0,0 +1,207 @@ + + + +
+

+ +

+ +
+ +
+ + {#if $ae_loc.authenticated_access} + {#if !$events_loc.pres_mgmt.hide__session_msg} + + {:else} + + {/if} + {/if} + + {#if $ae_loc.authenticated_access} + {#if !$events_loc.pres_mgmt.hide__session_code} + + {:else} + + {/if} + {/if} + + {#if $ae_loc.trusted_access} + {#if $events_loc.pres_mgmt.show__copy_access_link} + + {:else} + + {/if} + {/if} + + {#if $ae_loc.trusted_access} + {#if $events_loc.pres_mgmt.show__email_access_link} + + {:else} + + {/if} + {/if} + + + {#if $ae_loc.authenticated_access} + {#if $events_loc.pres_mgmt.show_content__session_qr} + + {:else} + + {/if} + {/if} + +
+ +
+ {#if $ae_loc.trusted_access} + {#if $ae_loc.edit_mode} + + {:else} + + {/if} + {/if} +
+ +
+ +
\ No newline at end of file diff --git a/src/routes/events_pres_mgmt/(launcher)/+layout.svelte b/src/routes/events_pres_mgmt/(launcher)/+layout.svelte deleted file mode 100644 index 85a26ed1..00000000 --- a/src/routes/events_pres_mgmt/(launcher)/+layout.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page.ts b/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page.ts deleted file mode 100644 index 23a3cbe2..00000000 --- a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page.ts +++ /dev/null @@ -1,130 +0,0 @@ -/** @type {import('./$types').PageLoad} */ -import { error } from '@sveltejs/kit'; -console.log(`ae pres_mgmt launcher [slug] +page.ts: start`); - -import { browser } from '$app/environment'; -import { events_func } from '$lib/ae_events_functions'; - -export async function load({ params, parent, url }) { // route - let log_lvl = 0; - - let data = await parent(); - // console.log(`ae events_pres_mgmt event [slug] +page.ts data:`, data); - data.log_lvl = log_lvl; - - let account_id = data.account_id; - let ae_acct = data[account_id]; - console.log(`ae_acct = `, ae_acct); - - // if (!account_id) { - // console.log(`ae pres_mgmt launcher [slug] +page.ts: The account_id was not found in the data!!!`); - // error(404, { - // message: 'Account ID not found' - // }); - // } - - let event_id = params.slug; - if (!event_id) { - console.log(`ae pres_mgmt launcher [slug] +layout.ts: The event_id was not found in the params.slug!!!`); - error(404, { - message: 'Event ID not found' - }); - } - - ae_acct.trig = {}; - - if (ae_acct.slct.event_id !== event_id) { - ae_acct.slct.event_id = event_id; - ae_acct.trig.event_id = true; - - // let load_event_obj = events_func.handle_load_ae_obj_id__event({ - // api_cfg: ae_acct.api, - // event_id: event_id, - // try_cache: false - // }); - - // ae_acct.slct.event_obj = await load_event_obj; - } - - if (browser) { - ae_acct.trig.event_location_obj_li = false; - let load_event_location_obj_li = await events_func.load_ae_obj_li__event_location({ - api_cfg: ae_acct.api, - event_id: event_id, - inc_file_li: true, - params: {qry__enabled: 'enabled', qry__limit: 550}, - try_cache: true - }) - .finally(() => { - // console.log(`load_event_location_obj_li = `, load_event_location_obj_li); - ae_acct.trig.event_location_obj_li = true; - }); - ae_acct.slct.event_location_obj_li = load_event_location_obj_li; - // console.log(`ae_acct.slct.event_location_obj_li = `, ae_acct.slct.event_location_obj_li); - - let id_li__event_location = []; - - let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery. - - for (let i = 0; i < load_event_location_obj_li.length; i++) { - let event_location_obj = load_event_location_obj_li[i]; - let event_location_id_random = event_location_obj.event_location_id_random; - tmp_li.push(event_location_id_random); - } - id_li__event_location = tmp_li; - console.log(`id_li__event_location:`, id_li__event_location); - ae_acct.slct.id_li__event_location = id_li__event_location; - } - - let for_obj_type = 'event'; - let for_obj_id = event_id; - - // ae_acct.trig.event_session_obj_li = true; - - - if (browser) { - console.log('HERE!!!'); - // if (url.searchParams.get('location_id')) { - // console.log(`url.searchParams.get('location_id') = `, url.searchParams.get('location_id')); - // for_obj_type = 'event_location'; - // for_obj_id = url.searchParams.get('location_id'); - // } - - ae_acct.trig.event_session_obj_li = false; - let load_event_session_obj_li = await events_func.load_ae_obj_li__event_session({ - api_cfg: ae_acct.api, - for_obj_type: for_obj_type, - for_obj_id: for_obj_id, - // inc_file_li: false, - // inc_presentation_li: false, - params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 150}, - try_cache: true - }) - .finally(() => { - // console.log(`load_event_session_obj_li = `, load_event_session_obj_li); - // ae_acct.trig.event_session_obj_li = false; - }); - ae_acct.slct.event_session_obj_li = load_event_session_obj_li; - // console.log(`ae_acct.slct.event_session_obj_li = `, ae_acct.slct.event_session_obj_li); - - let id_li__event_session = []; - - let tmp_li = []; // This is to prevent the array from constantly updating and triggering the liveQuery. - - for (let i = 0; i < load_event_session_obj_li.length; i++) { - let event_session_obj = load_event_session_obj_li[i]; - let event_session_id_random = event_session_obj.event_session_id_random; - tmp_li.push(event_session_id_random); - } - id_li__event_session = tmp_li; - console.log(`id_li__event_session:`, id_li__event_session); - ae_acct.slct.id_li__event_session = id_li__event_session; - } else { - console.log(`ae pres_mgmt launcher [slug] +page.ts: browser = false`); - } - - // WARNING: Precaution against shared data between sites and sessions. - data[account_id] = ae_acct; - - return data; -} diff --git a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page@(launcher).svelte b/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page@(launcher).svelte deleted file mode 100644 index b5b0e47c..00000000 --- a/src/routes/events_pres_mgmt/(launcher)/launcher/[slug]/+page@(launcher).svelte +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - - Launcher: - {ae_util.shorten_string({ string: $lq__event_obj?.name ?? '', max_length: 20, begin_length: 10, end_length: 4 })} - ({$lq__event_obj?.event_id ?? 'loading...'}) - Pres Mgmt - {$ae_loc?.title} - - - -{#if !$lq__event_obj} -
- - Loading... -
-{:else} -
-

Æ Presentation Launcher

-

{$lq__event_obj?.name}

-

{$lq__event_location_obj?.name} - {$events_loc.launcher.slct.event_location_id} -

-
-{/if} - - - -
- - - -
- - - - {#if $events_loc.launcher.slct.event_session_id && $lq__event_session_obj} - - - {/if} -
- -
- - \ No newline at end of file diff --git a/src/routes/events_pres_mgmt/event/[slug]/+page.ts b/src/routes/events_pres_mgmt/event/[slug]/+page.ts index 09a41129..aea203ac 100644 --- a/src/routes/events_pres_mgmt/event/[slug]/+page.ts +++ b/src/routes/events_pres_mgmt/event/[slug]/+page.ts @@ -43,7 +43,7 @@ export async function load({ params, parent }) { // route for_obj_id: event_id, params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, try_cache: true, - log_lvl: 1 + log_lvl: log_lvl }); console.log(`load_event_session_obj_li = `, load_event_session_obj_li); @@ -55,7 +55,7 @@ export async function load({ params, parent }) { // route for_obj_id: event_id, params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200}, try_cache: true, - log_lvl: 1 + log_lvl: log_lvl }); console.log(`load_event_location_obj_li = `, load_event_location_obj_li); diff --git a/src/routes/events_pres_mgmt/session_view.svelte b/src/routes/events_pres_mgmt/session_view.svelte index 7f5807b5..79488edc 100644 --- a/src/routes/events_pres_mgmt/session_view.svelte +++ b/src/routes/events_pres_mgmt/session_view.svelte @@ -405,7 +405,13 @@ $: if ($lq__event_session_obj) { // $slct.event_location_obj_li = await core_func.load_ae_obj_li__event_location({api_cfg: $ae_api, account_id: $slct.account_id, params: params}); - $slct.event_location_obj_li = events_func.load_ae_obj_li__event_location({api_cfg: $ae_api, event_id: $slct.event_id, params: params, log_lvl: 1}) + $slct.event_location_obj_li = events_func.load_ae_obj_li__event_location({ + api_cfg: $ae_api, + for_obj_type: 'event', + for_obj_id: $lq__event_session_obj?.event_id_random, + params: params, + log_lvl: log_lvl + }) .then(function (load_results) { console.log(`Loaded event_location_obj_li:`, load_results);