- Moved legacy event modules (`events_badges`, `events_leads`) to `src/routes/legacy/` and renamed them to `events_badges_v2` and `events_leads_v2` respectively.
- Created new directory structures for Svelte 5 and SvelteKit-based event modules under `src/routes/events/[event_id]/`:
- `(launcher)`
- `(badges)`
- `(leads)`
- Updated `src/routes/events_leads/README.md` (now `src/routes/legacy/events_leads_v2/README.md`) with comprehensive documentation for the legacy lead retrieval module, reflecting its features, data model, routing, components, and technical implementation details, incorporating project conventions.
58 lines
1.9 KiB
TypeScript
58 lines
1.9 KiB
TypeScript
/** @type {import('./$types').LayoutLoad} */
|
|
console.log(`ae_events_badges +layout.ts start`);
|
|
|
|
import { events_func } from '$lib/ae_events_functions';
|
|
|
|
export async function load({ parent }) {
|
|
const data = await parent();
|
|
// console.log(`ae_events_badges +layout.ts data:`, data);
|
|
|
|
const account_id = data.account_id;
|
|
const ae_acct = data[account_id];
|
|
console.log(`ae_acct = `, ae_acct);
|
|
|
|
if (!account_id) {
|
|
console.log(`events_badges +layout.ts: The account_id was not found in the data!!!`);
|
|
return false;
|
|
}
|
|
|
|
const event_id = ae_acct.slct.event_id;
|
|
if (!event_id) {
|
|
console.log(`events_badges +layout.ts: The event_id was not found in the data!!!`);
|
|
return false;
|
|
}
|
|
|
|
const 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;
|
|
|
|
const submenu = {
|
|
main: { name: 'Main', href: '/events_badges', access: false },
|
|
// manage: {name: 'Manage', href: '/events_badges/manage', access: 'administrator', disable: true, hide: true},
|
|
review: {
|
|
name: 'Review',
|
|
href: '/events_badges/review',
|
|
access: false,
|
|
disable: false,
|
|
hide: false
|
|
}
|
|
// print: {name: 'Print', href: '/events_badges/print', access: 'trusted', disable: true, hide: false},
|
|
// view: {name: 'View', href: '/events_badges/view', access: 'trusted', hide: true}, // event_badge_id
|
|
// new: {name: 'New', href: '/events_badges/new'},
|
|
// sponsorships: {name: 'Sponsorships', href: '/sponsorships', disable: true, hide: true},
|
|
};
|
|
data.submenu = submenu;
|
|
|
|
// WARNING: Precaution against shared data between sites and sessions.
|
|
data[account_id] = ae_acct;
|
|
|
|
return data;
|
|
}
|
|
|
|
// export const prerender = false;
|
|
// export const prerender = true;
|