More serious work on badge printing. Working on the templates and actually implementing the printable badge.
This commit is contained in:
@@ -7,6 +7,7 @@ import { db_events } from "$lib/ae_events/db_events";
|
||||
import { load_ae_obj_li__event_device } from './ae_events__event_device';
|
||||
import { load_ae_obj_li__event_location } from './ae_events__event_location';
|
||||
import { load_ae_obj_li__event_session } from './ae_events__event_session';
|
||||
import { load_ae_obj_li__event_badge_template } from "$lib/ae_events/ae_events__event_badge_template";
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
@@ -22,6 +23,8 @@ export async function load_ae_obj_id__event(
|
||||
inc_presentation_li = false,
|
||||
inc_presenter_li = false,
|
||||
inc_session_li = false,
|
||||
inc_badge_li = false,
|
||||
inc_template_li = false, // badge templates
|
||||
try_cache = true,
|
||||
log_lvl = 0
|
||||
}: {
|
||||
@@ -33,6 +36,8 @@ export async function load_ae_obj_id__event(
|
||||
inc_presentation_li?: boolean,
|
||||
inc_presenter_li?: boolean,
|
||||
inc_session_li?: boolean,
|
||||
inc_badge_li?: boolean,
|
||||
inc_template_li?: boolean,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
@@ -169,6 +174,33 @@ export async function load_ae_obj_id__event(
|
||||
ae_promises.load__event_obj.event_session_obj_li = load_event_session_obj_li;
|
||||
}
|
||||
|
||||
if (inc_template_li) {
|
||||
// Load the badge templates for the event
|
||||
log_lvl = 2;
|
||||
if (log_lvl) {
|
||||
console.log(`Need to load the badge template list for the event now`);
|
||||
}
|
||||
let load_event_badge_template_obj_li = load_ae_obj_li__event_badge_template({
|
||||
api_cfg: api_cfg,
|
||||
// for_obj_type: 'event',
|
||||
// for_obj_id: event_id,
|
||||
event_id: event_id,
|
||||
enabled: 'enabled',
|
||||
limit: 19,
|
||||
try_cache: try_cache,
|
||||
log_lvl: log_lvl
|
||||
}).then((event_badge_template_obj_li) => {
|
||||
if (log_lvl) {
|
||||
console.log(`event_badge_template_obj_li = `, event_badge_template_obj_li);
|
||||
}
|
||||
return event_badge_template_obj_li;
|
||||
});
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_badge_template_obj_li = `, load_event_badge_template_obj_li);
|
||||
}
|
||||
ae_promises.load__event_obj.event_badge_template_obj_li = load_event_badge_template_obj_li;
|
||||
}
|
||||
|
||||
return ae_promises.load__event_obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user