From 6b585090d0530bfefdbe40075863b54ca9bb76fd Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 22 May 2025 13:27:23 -0400 Subject: [PATCH] Clean up to get ready for CMSC and LCI. --- src/routes/+layout.svelte | 22 +++++++++++----------- src/routes/+layout.ts | 2 +- src/routes/core/+layout.ts | 25 ------------------------- src/routes/events/+layout.ts | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 47 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 34f0d363..01bce3d4 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -354,17 +354,17 @@ if ($ae_loc.site_access_key || $ae_loc.site_domain_access_key) { // BEGIN: Special Checks for Events, Sponsorships, IDAA, CHOW, etc.: // There should almost always be an event_id set. -if ($ae_loc?.site_cfg_json?.slct__event_id) { - $events_slct.event_id = $ae_loc.site_cfg_json.slct__event_id; - $events_loc.event_id = $ae_loc.site_cfg_json.slct__event_id; -} else if ($events_slct?.event_id) { - // console.log(`Event ID already set:`, $events_slct.event_id); - $events_loc.event_id = $events_slct.event_id; -} else { - if (log_lvl > 1) { - console.log(`No Event ID set!`); - } -} +// if ($ae_loc?.site_cfg_json?.slct__event_id) { +// $events_slct.event_id = $ae_loc.site_cfg_json.slct__event_id; +// $events_loc.event_id = $ae_loc.site_cfg_json.slct__event_id; +// } else if ($events_slct?.event_id) { +// // console.log(`Event ID already set:`, $events_slct.event_id); +// $events_loc.event_id = $events_slct.event_id; +// } else { +// if (log_lvl > 1) { +// console.log(`No Event ID set!`); +// } +// } // This is mainly for Precon CHOW if ($ae_loc?.site_cfg_json?.slct__sponsorship_cfg_id) { diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 4247526a..8f93136c 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -298,7 +298,7 @@ export async function load({ fetch, params, parent, route, url }) { // params, r // For events_leads, events_badges, events_speakers 'event_id': ae_loc_init.site_cfg_json?.slct__event_id, - 'event_badge_template': ae_loc_init.site_cfg_json?.slct__event_badge_template, + 'event_badge_template_id': ae_loc_init.site_cfg_json?.slct__event_badge_template_id, // For sponsorships 'sponsorship_cfg_id': ae_loc_init.site_cfg_json?.slct__sponsorship_cfg_id, diff --git a/src/routes/core/+layout.ts b/src/routes/core/+layout.ts index b7913c25..38db5ab1 100644 --- a/src/routes/core/+layout.ts +++ b/src/routes/core/+layout.ts @@ -21,31 +21,6 @@ export async function load({ parent }) { // console.log(`ae_acct = `, ae_acct); // } - // // // Should we limit these to event.conference = true? - // // let load_event_obj_li = events_func.load_ae_obj_li__event({ - // // api_cfg: ae_acct.api, - // // account_id: account_id, - // // params: {enabled: 'enabled', qry__limit: 25}, - // // try_cache: false, - // // log_lvl: 1 - // // }); - // // ae_acct.slct.event_obj_li = load_event_obj_li; - - - // let event_id = ae_acct.slct.event_id; - // if (!event_id) { - // console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the data!!!`); - // return false; - // } - - // let load_event_obj = events_func.load_ae_obj_id__event({ - // api_cfg: ae_acct.api, - // event_id: event_id, - // try_cache: true - // }); - - // ae_acct.slct.event_obj = load_event_obj; - // let submenu = { // main: {name: 'Main', href: '/events_pres_mgmt', access: false}, // // manage: {name: 'Manage', href: '/events_pres_mgmt/manage', access: 'administrator', disable: true, hide: true}, diff --git a/src/routes/events/+layout.ts b/src/routes/events/+layout.ts index eeeab743..d3a2bfb5 100644 --- a/src/routes/events/+layout.ts +++ b/src/routes/events/+layout.ts @@ -24,10 +24,10 @@ export async function load({ parent }) { } let event_id = ae_acct.slct.event_id; // From root +layout.ts - if (!event_id) { - console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the data!!!`); - return false; - } + // if (!event_id) { + // console.log(`ERROR: events_pres_mgmt +layout.ts: The event_id was not found in the data!!!`); + // return false; + // } if (browser) { if (log_lvl) { @@ -55,12 +55,12 @@ export async function load({ parent }) { // ae_acct.slct.event_obj = load_event_obj; - let submenu = { - main: {name: 'Main', href: '/events_pres_mgmt', access: false}, - // manage: {name: 'Manage', href: '/events_pres_mgmt/manage', access: 'administrator', disable: true, hide: true}, - locations: {name: 'Locations', href: `/events/${event_id}/locations`, access: false, disable: false, hide: false}, - }; - data.submenu = submenu + // let submenu = { + // main: {name: 'Main', href: '/events_pres_mgmt', access: false}, + // // manage: {name: 'Manage', href: '/events_pres_mgmt/manage', access: 'administrator', disable: true, hide: true}, + // locations: {name: 'Locations', href: `/events/${event_id}/locations`, access: false, disable: false, hide: false}, + // }; + // data.submenu = submenu // WARNING: Precaution against shared data between sites and sessions. data[account_id] = ae_acct;