Lots of work on things for LCI! Should have saved more often.
This commit is contained in:
@@ -57,7 +57,7 @@ async function handle_load_ae_obj_li__event(
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_load_ae_obj_li__event() ***`);
|
||||
console.log(`*** handle_load_ae_obj_li__event() *** account_id=${account_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
@@ -103,6 +103,51 @@ async function handle_load_ae_obj_li__event(
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
async function handle_load_ae_obj_id__event_session(
|
||||
{
|
||||
api_cfg,
|
||||
event_session_id,
|
||||
try_cache=false,
|
||||
log_lvl=0
|
||||
} : {
|
||||
api_cfg: any,
|
||||
event_session_id: string,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_load_ae_obj_id__event_session() *** event_session_id=${event_session_id}`);
|
||||
|
||||
let params = {};
|
||||
|
||||
// $events_sess.badges.status_load__event_session_obj = 'loading';
|
||||
ae_promises.load__event_session_obj = await api.get_ae_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_session',
|
||||
obj_id: event_session_id, // NOTE: This is the FQDN, not normally the ID.
|
||||
use_alt_table: false, // 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 in the API config.
|
||||
params: params,
|
||||
log_lvl: 0
|
||||
})
|
||||
.then(function (event_session_obj_get_result) {
|
||||
if (event_session_obj_get_result) {
|
||||
// This is expecting a list
|
||||
handle_db_save_ae_obj_li__event_session({obj_type: 'event_session', obj_li: [event_session_obj_get_result]});
|
||||
return event_session_obj_get_result;
|
||||
} else {
|
||||
console.log('No results returned.');
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
return ae_promises.load__event_session_obj;
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-05-24
|
||||
async function handle_load_ae_obj_li__event_session(
|
||||
@@ -163,6 +208,127 @@ async function handle_load_ae_obj_li__event_session(
|
||||
return ae_promises.load__event_session
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
async function handle_load_ae_obj_li__event_presentation(
|
||||
{
|
||||
api_cfg,
|
||||
event_session_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
} : {
|
||||
api_cfg: any,
|
||||
event_session_id: string,
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_load_ae_obj_li__event_presentation() *** event_session_id=${event_session_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
let limit: number = (params.qry__limit ?? 99); // 99
|
||||
let offset: number = (params.qry__offset ?? 0); // 0
|
||||
|
||||
let params_json: key_val = {};
|
||||
|
||||
// console('params_json:', params_json);
|
||||
|
||||
ae_promises.load__event_presentation_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presentation',
|
||||
for_obj_type: 'event_session',
|
||||
for_obj_id: event_session_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: {'start_datetime': 'ASC', 'name': 'ASC', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then(function (event_presentation_obj_li_get_result) {
|
||||
if (event_presentation_obj_li_get_result) {
|
||||
handle_db_save_ae_obj_li__event_presentation({obj_type: 'event_presentation', obj_li: event_presentation_obj_li_get_result});
|
||||
return event_presentation_obj_li_get_result;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_presentation_obj_li:', ae_promises.load__event_presentation_obj_li);
|
||||
return ae_promises.load__event_presentation_obj_li;
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
async function handle_load_ae_obj_li__event_presenter(
|
||||
{
|
||||
api_cfg,
|
||||
event_presentation_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
} : {
|
||||
api_cfg: any,
|
||||
event_presentation_id: string,
|
||||
params?: key_val,
|
||||
try_cache?: boolean,
|
||||
log_lvl?: number
|
||||
}
|
||||
) {
|
||||
console.log(`*** handle_load_ae_obj_li__event_presenter() *** event_presentation_id=${event_presentation_id}`);
|
||||
|
||||
let enabled: string = (params.qry__enabled ?? 'enabled'); // all, disabled, enabled
|
||||
let hidden: string = (params.qry__hidden ?? 'not_hidden'); // all, hidden, not_hidden
|
||||
let limit: number = (params.qry__limit ?? 99); // 99
|
||||
let offset: number = (params.qry__offset ?? 0); // 0
|
||||
|
||||
let params_json: key_val = {};
|
||||
|
||||
// console.log('params_json:', params_json);
|
||||
|
||||
ae_promises.load__event_presenter_obj_li = await api.get_ae_obj_li_for_obj_id_crud({
|
||||
api_cfg: api_cfg,
|
||||
obj_type: 'event_presenter',
|
||||
for_obj_type: 'event_presentation',
|
||||
for_obj_id: event_presentation_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', 'updated_on': 'DESC', 'created_on': 'DESC'},
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
params_json: params_json,
|
||||
params: params,
|
||||
log_lvl: log_lvl
|
||||
})
|
||||
.then(function (event_presenter_obj_li_get_result) {
|
||||
if (event_presenter_obj_li_get_result) {
|
||||
handle_db_save_ae_obj_li__event_presenter({obj_type: 'event_presenter', obj_li: event_presenter_obj_li_get_result});
|
||||
return event_presenter_obj_li_get_result;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('No results returned or failed.', error);
|
||||
});
|
||||
|
||||
console.log('ae_promises.load__event_presenter_obj_li:', ae_promises.load__event_presenter_obj_li);
|
||||
return ae_promises.load__event_presenter_obj_li;
|
||||
}
|
||||
|
||||
|
||||
async function handle_load_ae_obj_id__badge({api_cfg, badge_id, try_cache=false}) {
|
||||
console.log(`*** handle_load_ae_obj_id__badge() *** badge_id=${badge_id}`);
|
||||
|
||||
@@ -199,17 +365,17 @@ async function handle_load_ae_obj_id__badge({api_cfg, badge_id, try_cache=false}
|
||||
// Updated 2024-03-06
|
||||
async function handle_load_ae_obj_li__badge(
|
||||
{
|
||||
api_cfg,
|
||||
event_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
api_cfg,
|
||||
event_id,
|
||||
params={},
|
||||
try_cache=true,
|
||||
log_lvl=0
|
||||
}: {
|
||||
api_cfg: any,
|
||||
event_id: any,
|
||||
params: any,
|
||||
try_cache?: boolean,
|
||||
log_lvl: number
|
||||
api_cfg: any,
|
||||
event_id: any,
|
||||
params: any,
|
||||
try_cache?: boolean,
|
||||
log_lvl: number
|
||||
}) {
|
||||
console.log(`*** handle_load_ae_obj_li__badge() *** event_id=${event_id}`);
|
||||
|
||||
@@ -1015,8 +1181,13 @@ function handle_db_save_ae_obj_li__event_session({obj_type, obj_li}) {
|
||||
start_datetime: obj.start_datetime,
|
||||
end_datetime: obj.end_datetime,
|
||||
|
||||
passcode: obj.passcode,
|
||||
|
||||
hide_event_launcher: obj.hide_event_launcher,
|
||||
|
||||
alert: obj.alert,
|
||||
alert_msg: obj.alert_msg,
|
||||
|
||||
enable: obj.enable,
|
||||
hide: obj.hide,
|
||||
priority: obj.priority,
|
||||
@@ -1025,6 +1196,11 @@ function handle_db_save_ae_obj_li__event_session({obj_type, obj_li}) {
|
||||
notes: obj.notes,
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// From SQL view
|
||||
// event_name: obj.event_name,
|
||||
event_location_code: obj.event_location_code,
|
||||
event_location_name: obj.event_location_name,
|
||||
});
|
||||
// console.log(`Put obj with ID: ${obj.event_session_id_random} or ${id_random}`);
|
||||
} catch (error) {
|
||||
@@ -1041,6 +1217,140 @@ function handle_db_save_ae_obj_li__event_session({obj_type, obj_li}) {
|
||||
}
|
||||
|
||||
|
||||
// This function will loop through the event_presentation_obj_li and save each one to the DB.
|
||||
// Updated 2024-06-10
|
||||
function handle_db_save_ae_obj_li__event_presentation({obj_type, obj_li}) {
|
||||
console.log(`*** handle_db_save_ae_obj_li__event_presentation() ***`);
|
||||
|
||||
if (obj_li && obj_li.length) {
|
||||
obj_li.forEach(async function (obj) {
|
||||
// console.log(`ae_obj ${obj_type}:`, obj);
|
||||
|
||||
try {
|
||||
const id_random = await db_events.presentations.put({
|
||||
id_random: obj.event_presentation_id_random,
|
||||
event_presentation_id_random: obj.event_presentation_id_random,
|
||||
external_id: obj.external_id,
|
||||
code: obj.code,
|
||||
|
||||
for_type: obj.for_type,
|
||||
for_id_random: obj.for_id_random,
|
||||
|
||||
type_code: obj.type_code,
|
||||
|
||||
event_id_random: obj.event_id_random,
|
||||
event_session_id_random: obj.event_session_id_random,
|
||||
event_abstract_id_random: obj.event_abstract_id_random,
|
||||
|
||||
abstract_code: obj.abstract_code,
|
||||
|
||||
name: obj.name,
|
||||
description: obj.description,
|
||||
|
||||
start_datetime: obj.start_datetime,
|
||||
end_datetime: obj.end_datetime,
|
||||
|
||||
passcode: obj.passcode,
|
||||
|
||||
hide_event_launcher: obj.hide_event_launcher,
|
||||
|
||||
enable: obj.enable,
|
||||
hide: obj.hide,
|
||||
priority: obj.priority,
|
||||
sort: obj.sort,
|
||||
group: obj.group,
|
||||
notes: obj.notes,
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
});
|
||||
// console.log(`Put obj with ID: ${obj.event_presentation_id_random} or ${id_random}`);
|
||||
} catch (error) {
|
||||
let status = `Failed to put ${obj.event_presentation_id_random}: ${error}`;
|
||||
console.log(status);
|
||||
}
|
||||
|
||||
// const id_random = await db_events.presentations.put(obj);
|
||||
// console.log(`Put obj with ID: ${obj.event_presentation_id_random}`);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
function handle_db_save_ae_obj_li__event_presenter({obj_type, obj_li}) {
|
||||
console.log(`*** handle_db_save_ae_obj_li__event_presenter() ***`);
|
||||
|
||||
if (obj_li && obj_li.length) {
|
||||
obj_li.forEach(async function (obj) {
|
||||
// console.log(`ae_obj ${obj_type}:`, obj);
|
||||
|
||||
try {
|
||||
const id_random = await db_events.presenters.put({
|
||||
id_random: obj.event_presenter_id_random,
|
||||
event_presenter_id_random: obj.event_presenter_id_random,
|
||||
external_id: obj.external_id,
|
||||
code: obj.code,
|
||||
|
||||
// for_type: obj.for_type,
|
||||
// for_id_random: obj.for_id_random,
|
||||
|
||||
event_id_random: obj.event_id_random,
|
||||
event_session_id_random: obj.event_session_id_random,
|
||||
event_person_id_random: obj.event_person_id_random,
|
||||
event_presentation_id_random: obj.event_presentation_id_random,
|
||||
person_id_random: obj.person_id_random,
|
||||
person_profile_id_random: obj.person_profile_id_random, // The new table person_profile will be used soon...
|
||||
|
||||
pronouns: obj.pronouns,
|
||||
informal_name: obj.informal_name,
|
||||
title_names: obj.title_names,
|
||||
given_name: obj.given_name,
|
||||
middle_name: obj.middle_name,
|
||||
family_name: obj.family_name,
|
||||
designations: obj.designations,
|
||||
|
||||
professional_title: obj.professional_title,
|
||||
|
||||
full_name: obj.full_name,
|
||||
|
||||
affiliations: obj.affiliations,
|
||||
|
||||
email: obj.email,
|
||||
|
||||
biography: obj.biography,
|
||||
|
||||
agree: obj.agree,
|
||||
comments: obj.comments,
|
||||
|
||||
passcode: obj.passcode,
|
||||
|
||||
hide_event_launcher: obj.hide_event_launcher,
|
||||
|
||||
enable: obj.enable,
|
||||
hide: obj.hide,
|
||||
priority: obj.priority,
|
||||
sort: obj.sort,
|
||||
group: obj.group,
|
||||
notes: obj.notes,
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
});
|
||||
// console.log(`Put obj with ID: ${obj.event_presenter_id_random} or ${id_random}`);
|
||||
} catch (error) {
|
||||
let status = `Failed to put ${obj.event_presenter_id_random}: ${error}`;
|
||||
console.log(status);
|
||||
}
|
||||
|
||||
// const id_random = await db_events.presenters.put(obj);
|
||||
// console.log(`Put obj with ID: ${obj.event_presenter_id_random}`);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function handle_download_export__event_exhibit_tracking(
|
||||
{
|
||||
@@ -1081,8 +1391,13 @@ let export_obj = {
|
||||
handle_load_ae_obj_id__event: handle_load_ae_obj_id__event,
|
||||
handle_load_ae_obj_li__event: handle_load_ae_obj_li__event,
|
||||
|
||||
handle_load_ae_obj_id__event_session: handle_load_ae_obj_id__event_session,
|
||||
handle_load_ae_obj_li__event_session: handle_load_ae_obj_li__event_session,
|
||||
|
||||
handle_load_ae_obj_li__event_presentation: handle_load_ae_obj_li__event_presentation,
|
||||
|
||||
handle_load_ae_obj_li__event_presenter: handle_load_ae_obj_li__event_presenter,
|
||||
|
||||
handle_load_ae_obj_id__badge: handle_load_ae_obj_id__badge,
|
||||
handle_load_ae_obj_li__badge: handle_load_ae_obj_li__badge,
|
||||
handle_search__event_badge: handle_search__event_badge,
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { key_val } from '$lib/ae_stores';
|
||||
// Longer-term app data. This should be stored to *local* storage.
|
||||
// Updated 2024-03-06
|
||||
let events_local_data_struct: key_val = {
|
||||
'ver': '2024-03-12_19',
|
||||
'ver': '2024-06-11_11',
|
||||
// Shared
|
||||
'name': 'Aether - Events (SvelteKit 2.x Svelte 4.x)',
|
||||
'title': `OSIT's Æ Events`, // - Dev SvelteKit`, // Æ
|
||||
@@ -31,6 +31,45 @@ let events_local_data_struct: key_val = {
|
||||
// The show details is intended for things like meta data and additional details that are not always needed.
|
||||
show_details: false,
|
||||
|
||||
auth__person: {}, // allow, id, name, email, passcode, etc
|
||||
// The auth__entered_key (usually email or person_id) and auth__entered_passcode is found under events_sess.entered_key and events_sess.entered_passcode because it should be temporary.
|
||||
// auth__entered_passcode: null,
|
||||
|
||||
// The auth__kv (key value pairs) is used to store the xyz IDs that the browser client can access. This is a key value list of xyz ID and created datetime stamp (or just true). These should not be more than X days old.
|
||||
auth__kv: {
|
||||
event: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
exhibit: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
location: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
session: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
presentation: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
presenter: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
person: {
|
||||
// 'LNDF-67-89-92': true
|
||||
},
|
||||
},
|
||||
|
||||
// auth__session_kv: {
|
||||
// // {'LNDF-67-89-92': true}
|
||||
// },
|
||||
// auth__presentation_kv: {
|
||||
// // {'LNDF-67-89-92': true}
|
||||
// },
|
||||
// auth__presenter_kv: {
|
||||
// // {'LNDF-67-89-92': true}
|
||||
// },
|
||||
|
||||
// Badge Printing
|
||||
'badges': {
|
||||
auto_view: true,
|
||||
@@ -57,7 +96,7 @@ let events_local_data_struct: key_val = {
|
||||
show_content__scan_requirements: true,
|
||||
show_content__custom_question_descriptions: true,
|
||||
show_content__email_link_warning: true,
|
||||
|
||||
|
||||
default_to_scan: true,
|
||||
|
||||
// For ISHLT 2024 Annual Meeting only!
|
||||
@@ -93,6 +132,12 @@ let events_local_data_struct: key_val = {
|
||||
},
|
||||
|
||||
// Presentation Management (Distributing)
|
||||
'pres_mgmt': {
|
||||
show_content__session_description: false,
|
||||
show_content__presentation_description: false,
|
||||
show_content__agree_text: false,
|
||||
show_content__presenter_start: false,
|
||||
},
|
||||
|
||||
// Speakers Management (Collection)
|
||||
'speakers': {
|
||||
|
||||
@@ -192,6 +192,8 @@ export interface Session {
|
||||
start_datetime: Date;
|
||||
end_datetime: Date;
|
||||
|
||||
passcode: null|string;
|
||||
|
||||
hide_event_launcher: null|boolean;
|
||||
|
||||
enable: null|boolean;
|
||||
@@ -204,6 +206,93 @@ export interface Session {
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
// Updated 2024-06-10
|
||||
export interface Presentation {
|
||||
id_random: string;
|
||||
event_presentation_id_random: string;
|
||||
external_id: string;
|
||||
code: string;
|
||||
|
||||
for_type: string;
|
||||
for_id_random: string;
|
||||
|
||||
type_code: string;
|
||||
|
||||
event_id_random: string;
|
||||
event_session_id_random: string;
|
||||
event_abstract_id_random: string;
|
||||
|
||||
abstract_code: string;
|
||||
|
||||
name: string;
|
||||
description: null|string;
|
||||
|
||||
start_datetime: Date;
|
||||
end_datetime: Date;
|
||||
|
||||
hide_event_launcher: null|boolean;
|
||||
|
||||
enable: null|boolean;
|
||||
hide: null|boolean;
|
||||
priority: null|boolean
|
||||
sort: null|number;
|
||||
group: null|string;
|
||||
notes: null|string;
|
||||
created_on: Date;
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
// Updated 2024-06-10
|
||||
export interface Presenter {
|
||||
id_random: string;
|
||||
event_presenter_id_random: string;
|
||||
external_id: string;
|
||||
code: string;
|
||||
|
||||
event_id_random: string;
|
||||
event_session_id_random: string;
|
||||
event_person_id_random: string;
|
||||
event_presentation_id_random: string;
|
||||
person_id_random: string;
|
||||
person_profile_id_random: string; // The new table person_profile will be used soon...
|
||||
|
||||
pronouns: null|string;
|
||||
informal_name: null|string;
|
||||
title_names: null|string;
|
||||
given_name: string;
|
||||
middle_name: null|string;
|
||||
family_name: null|string;
|
||||
designations: null|string;
|
||||
|
||||
professional_title: null|string;
|
||||
|
||||
full_name: string;
|
||||
|
||||
affiliations: null|string;
|
||||
|
||||
email: string;
|
||||
|
||||
biography: null|string;
|
||||
|
||||
agree: null|boolean;
|
||||
comments: null|string;
|
||||
|
||||
passcode: null|string;
|
||||
|
||||
hide_event_launcher: null|boolean;
|
||||
|
||||
enable: null|boolean;
|
||||
hide: null|boolean;
|
||||
priority: null|boolean
|
||||
sort: null|number;
|
||||
group: null|string;
|
||||
notes: null|string;
|
||||
created_on: Date;
|
||||
updated_on: null|Date;
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-10
|
||||
export class MySubClassedDexie extends Dexie {
|
||||
// 'badges' is added by dexie when declaring the stores()
|
||||
// We just tell the typing system this is the case
|
||||
@@ -250,6 +339,26 @@ export class MySubClassedDexie extends Dexie {
|
||||
for_type, for_id_random, type_code,
|
||||
event_id_random, event_location_id_random,
|
||||
name, description, start_datetime, end_datetime,
|
||||
passcode,
|
||||
hide_event_launcher,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on
|
||||
`,
|
||||
|
||||
presentations: `
|
||||
id_random, event_presentation_id_random, external_id, code,
|
||||
for_type, for_id_random, type_code,
|
||||
event_id_random, event_session_id_random, event_abstract_id_random,
|
||||
abstract_code, name, description, start_datetime, end_datetime,
|
||||
hide_event_launcher,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on`,
|
||||
|
||||
presenters: `
|
||||
id_random, event_presenter_id_random, external_id, code,
|
||||
event_id_random, event_session_id_random, event_person_id_random, event_presentation_id_random,
|
||||
person_id_random, person_profile_id_random,
|
||||
pronouns, informal_name, title_names, given_name, middle_name, family_name, designations,
|
||||
professional_title, full_name, affiliations, email,
|
||||
biography, agree, comments, passcode,
|
||||
hide_event_launcher,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on`,
|
||||
});
|
||||
|
||||
@@ -44,6 +44,7 @@ onMount(() => {
|
||||
</svelte:head>
|
||||
|
||||
|
||||
{#if $ae_loc.administrator_access && 1==2}
|
||||
<section
|
||||
class="submenu flex flex-row justify-center"
|
||||
class:hidden={$ae_loc.iframe}
|
||||
@@ -84,6 +85,7 @@ onMount(() => {
|
||||
</span>
|
||||
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
||||
<slot></slot>
|
||||
|
||||
@@ -16,7 +16,11 @@ import Element_data_store from '$lib/element_data_store.svelte';
|
||||
|
||||
|
||||
let event_obj_li = liveQuery(
|
||||
() => db_events.events.toArray()
|
||||
() => db_events.events
|
||||
.orderBy('start_datetime')
|
||||
.reverse()
|
||||
.toArray()
|
||||
// .sortBy('start_datetime')
|
||||
// () => db_events.events
|
||||
// .where('conference')
|
||||
// // .aboveOrEqual(0)
|
||||
|
||||
745
src/routes/events_pres_mgmt/session/[slug]/+page.svelte
Normal file
745
src/routes/events_pres_mgmt/session/[slug]/+page.svelte
Normal file
@@ -0,0 +1,745 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data: any;
|
||||
// console.log(`ae_events_pres_mgmt event [slug] +page.svelte data:`, data);
|
||||
|
||||
import { onMount } from 'svelte';
|
||||
import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
||||
|
||||
import { clipboard, FileDropzone, getModalStore, localStorageStore, ProgressRadial, RadioGroup, RadioItem, TabGroup, Tab, TabAnchor } from '@skeletonlabs/skeleton';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils';
|
||||
import { api, send_email } from '$lib/api';
|
||||
import Element_data_store from '$lib/element_data_store.svelte';
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
|
||||
// These will likely be used for patch/update triggers. Maybe delete?
|
||||
let ae_triggers: key_val = {};
|
||||
|
||||
let ae_promises: key_val = {}; // Promise<any>;
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { db_events } from "$lib/db_events";
|
||||
import { ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
$slct.account_id = data.account_id;
|
||||
console.log(`$slct.account_id = `, $slct.account_id);
|
||||
let ae_acct = data[$slct.account_id];
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
$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;
|
||||
|
||||
if (!$events_loc.auth__person) {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
};
|
||||
}
|
||||
|
||||
if (!$events_loc.auth__kv) {
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
presentation: {},
|
||||
presenter: {},
|
||||
person: {},
|
||||
};
|
||||
}
|
||||
|
||||
if (!$events_loc.pres_mgmt) {
|
||||
$events_loc.pres_mgmt = {};
|
||||
$events_loc.pres_mgmt.show_content__agree_text = null;
|
||||
}
|
||||
|
||||
// import Leads_add_scan from './leads_add_scan.svelte';
|
||||
// import Sessions_list from './sessions_list.svelte';
|
||||
// import Leads_manage from './leads_manage.svelte';
|
||||
// import Leads_payment from './leads_payment.svelte';
|
||||
|
||||
// let param_slug_event_id = data.params.slug;
|
||||
|
||||
let event_obj = liveQuery(
|
||||
() => db_events.events.get($events_slct.event_id)
|
||||
// () => db_events.events.get(param_slug_event_id)
|
||||
// () => db_events.events.toArray()
|
||||
// () => db_events.events
|
||||
// .where('id_random')
|
||||
// .equals($events_slct.event_id)
|
||||
// // .orderBy('name')
|
||||
// // .offset(10).limit(5)
|
||||
// .toArray()
|
||||
);
|
||||
|
||||
let event_obj_v2 = db_events.events.get($events_slct.event_id);
|
||||
|
||||
|
||||
let event_session_obj = liveQuery(
|
||||
() => db_events.sessions.get($events_slct.event_session_id)
|
||||
);
|
||||
|
||||
let event_presentation_obj_li = liveQuery(
|
||||
() => db_events.presentations.where('event_session_id_random').equals($events_slct.event_session_id_random).toArray()
|
||||
);
|
||||
|
||||
// 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);
|
||||
// $events_trigger = 'load__event_obj';
|
||||
|
||||
// let license_submit_results: Promise<any>|key_val;
|
||||
|
||||
// if (!$events_loc.leads.tab) {
|
||||
// $events_loc.leads.tab = {};
|
||||
// $events_loc.leads.tab[$events_slct.event_id] = 'start';
|
||||
// }
|
||||
|
||||
// if (!$events_loc.leads.auth_exhibit_kv) {
|
||||
// $events_loc.leads.auth_exhibit_kv = {};
|
||||
// }
|
||||
|
||||
// if ($events_loc.leads.auth_exhibit_kv && $events_loc.leads.auth_exhibit_kv[$events_slct.event_id]) {
|
||||
// console.log('Logged in using shared exhibit staff passcode.');
|
||||
|
||||
// if ($events_loc.leads.auth_exhibit_kv[$events_slct.event_id].key) {
|
||||
// console.log(`Using the license key: ${$events_loc.leads.auth_exhibit_kv[$events_slct.event_id].key}`);
|
||||
// } else {
|
||||
// console.log('License key (email) not used.');
|
||||
// $events_loc.leads.tab[$events_slct.event_id] = 'start';
|
||||
// }
|
||||
// } else {
|
||||
// console.log('Not logged in using shared exhibit staff passcode.');
|
||||
// $events_loc.leads.tab[$events_slct.event_id] = 'start';
|
||||
// }
|
||||
|
||||
|
||||
onMount(() => {
|
||||
console.log('Events Session [slug]: +page.svelte');
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
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}`);
|
||||
|
||||
$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');
|
||||
// data.url.searchParams.delete('person_pass');
|
||||
let new_url = data.url.toString()
|
||||
console.log(new_url);
|
||||
goto(new_url, {replaceState: true});
|
||||
}
|
||||
|
||||
});
|
||||
// console.log(`$ae_loc = `, $ae_loc);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<section
|
||||
class="ae_events_pres_mgmt_event_session md:container h-full mx-auto flex flex-col space-y-4 pt-0 pb-8"
|
||||
>
|
||||
|
||||
|
||||
{#if $events_slct.event_session_id && $event_session_obj}
|
||||
|
||||
<h2 class="h2 text-center">{$event_session_obj.name}</h2>
|
||||
|
||||
<!-- Information about the session -->
|
||||
<section>
|
||||
<h3 class="h3">Session Information:</h3>
|
||||
|
||||
<ul
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
<li>
|
||||
<strong class="text-sm">Name/Title:</strong> {$event_session_obj.name}
|
||||
<span class="text-sm text-gray-500 bg-yellow-100 p-1 rounded-md border border-yellow-200"
|
||||
title="Session code {$event_session_obj.code}"
|
||||
>
|
||||
<span class="fas fa-barcode"></span>
|
||||
{$event_session_obj.code}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong class="text-sm">Date time:</strong> {ae_util.iso_datetime_formatter($event_session_obj.start_datetime, 'datetime_long')} - {ae_util.iso_datetime_formatter($event_session_obj.end_datetime, 'datetime_long')}
|
||||
</li>
|
||||
<li>
|
||||
<strong class="text-sm">Location/Room:</strong> {$event_session_obj.event_location_name ? $event_session_obj.event_location_name : '-- not set --'}
|
||||
</li>
|
||||
{#if $ae_loc.trusted_access}
|
||||
<li>
|
||||
<strong class="text-sm">Session passcode:</strong> {$event_session_obj.passcode ? $event_session_obj.passcode : '-- not set --'}
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
<li>
|
||||
<div>
|
||||
<strong class="text-sm">
|
||||
Session description:
|
||||
</strong>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Show/Hide Description');
|
||||
$events_loc.pres_mgmt.show_content__session_description = !$events_loc.pres_mgmt.show_content__session_description;
|
||||
}}
|
||||
class="btn btn-sm variant-soft-surface"
|
||||
>
|
||||
{#if $events_loc.pres_mgmt.show_content__session_description}
|
||||
<span class="fas fa-eye-slash mx-1"></span>
|
||||
<span class="text-xs">Hide Description</span>
|
||||
{:else}
|
||||
<span class="fas fa-eye mx-1"></span>
|
||||
<span class="text-xs">Show</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={!$events_loc.pres_mgmt.show_content__session_description}
|
||||
>{$event_session_obj.description}</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <label
|
||||
class="text-sm"
|
||||
>Session description:
|
||||
<textarea
|
||||
class="textarea my-1 p-2"
|
||||
cols="30"
|
||||
rows="4"
|
||||
disabled
|
||||
>{$event_session_obj.description}</textarea>
|
||||
</label> -->
|
||||
|
||||
<div class="m-1 flex flex-col flex-wrap gap-1 items-center">
|
||||
{#if $ae_loc.trusted_access || $events_loc.auth__kv.session[$events_slct.event_session_id]}
|
||||
|
||||
{#if $events_slct.presenter_obj.agree}
|
||||
<button
|
||||
class="btn btn-md variant-ghost-primary"
|
||||
>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
Download
|
||||
LCI Congress Template 2024 (PowerPoint)
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-md variant-ghost-primary"
|
||||
>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
Download
|
||||
LCI Speaker and Champion Congress Task List (Excel)
|
||||
</button>
|
||||
{:else}
|
||||
<span class="text-xl text-red-500 font-bold text-center">
|
||||
<p><strong>Read and Consent Agreement?</strong></p>
|
||||
<p>
|
||||
Please select your name below to view, read, and consent the agreement.
|
||||
</p>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
on:click={() => {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
};
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
presentation: {},
|
||||
presenter: {},
|
||||
person: {},
|
||||
};
|
||||
alert('You have been signed out.');
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Sign Out
|
||||
</button>
|
||||
|
||||
{:else}
|
||||
<div class="text-xl text-red-500 font-bold text-center">
|
||||
<p><strong>Restricted access!</strong></p>
|
||||
<p>
|
||||
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.
|
||||
<!-- This email address must match your LCI member record. -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Enter your key and passcode to sign in:
|
||||
<input
|
||||
type="text"
|
||||
class="input max-w-36"
|
||||
placeholder="Key"
|
||||
value={$events_sess.entered_key}
|
||||
on:input={(e) => $events_sess.entered_key = e.target.value}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="input max-w-36"
|
||||
placeholder="Passcode"
|
||||
value={$events_sess.entered_passcode}
|
||||
on:input={(e) => $events_sess.entered_passcode = e.target.value}
|
||||
>
|
||||
<button
|
||||
class="btn btn-md variant-ghost-primary"
|
||||
on:click={() => {
|
||||
console.log('Sign in');
|
||||
$events_loc.auth__person.id = $events_sess.entered_key; // person_id
|
||||
$events_loc.auth__person.entered_key = $events_sess.entered_key; // also person_id in this case
|
||||
$events_loc.auth__person.email = 'test@example.com';
|
||||
$events_loc.auth__person.full_name = 'Test Person';
|
||||
|
||||
$events_loc.auth__kv.person[$events_sess.entered_key] = true;
|
||||
$events_loc.auth__kv.session[$events_slct.event_session_id] = true;
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Sign In
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
on:click={() => {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
};
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
presentation: {},
|
||||
presenter: {},
|
||||
person: {},
|
||||
};
|
||||
alert('You have been signed out.');
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Sign Out
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <button
|
||||
class="btn btn-md variant-soft-primary"
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Email Access Link
|
||||
</button> -->
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<!-- Presentations in the session -->
|
||||
<section>
|
||||
<h3 class="h3">Presentations:</h3>
|
||||
{#await $events_slct.event_presentation_obj_li}
|
||||
<p>Loading...</p>
|
||||
{:then event_presentation_obj_li}
|
||||
{#if event_presentation_obj_li && event_presentation_obj_li.length > 0}
|
||||
<ul
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
{#each event_presentation_obj_li as event_presentation_obj}
|
||||
<li>
|
||||
<h4 class="h4">
|
||||
{event_presentation_obj.name}
|
||||
{#if event_presentation_obj.code || event_presentation_obj.abstract_code}
|
||||
<span class="text-sm text-gray-500 bg-yellow-100 p-1 rounded-md border border-yellow-200"
|
||||
title="Presentation code {event_presentation_obj.code} and abstract code {event_presentation_obj.abstract_code}"
|
||||
>
|
||||
<span class="fas fa-barcode"></span>
|
||||
{event_presentation_obj.code ?? ''} {event_presentation_obj.abstract_code ?? ''}
|
||||
</span>
|
||||
{/if}
|
||||
</h4>
|
||||
|
||||
<div>
|
||||
<strong class="text-sm">
|
||||
Description:
|
||||
</strong>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Show/Hide Description');
|
||||
if ($events_loc.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id_random) {
|
||||
$events_loc.pres_mgmt.show_content__presentation_description = null;
|
||||
} else {
|
||||
$events_loc.pres_mgmt.show_content__presentation_description = event_presentation_obj.event_presentation_id_random;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-soft-surface"
|
||||
>
|
||||
{#if $events_loc.pres_mgmt.show_content__presentation_description == event_presentation_obj.event_presentation_id_random}
|
||||
<span class="fas fa-eye-slash mx-1"></span>
|
||||
<span class="text-xs">Hide Description</span>
|
||||
{:else}
|
||||
<span class="fas fa-eye mx-1"></span>
|
||||
<span class="text-xs">Show</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={$events_loc.pres_mgmt.show_content__presentation_description !== event_presentation_obj.event_presentation_id_random}
|
||||
>{event_presentation_obj.description}</pre>
|
||||
|
||||
{#await event_presentation_obj.event_presenter_li}
|
||||
<p>Loading...</p>
|
||||
{:then event_presenter_li}
|
||||
{#if event_presenter_li && event_presenter_li.length > 0}
|
||||
<strong class="text-sm">Presenters:</strong>
|
||||
<ul
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
{#each event_presenter_li as event_presenter_obj}
|
||||
<li>
|
||||
{#if event_presenter_obj.agree}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-md variant-outline-success"
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View presenter details');
|
||||
|
||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
$events_slct.presentation_obj = event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||
$events_slct.presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_loc.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
}
|
||||
title="Agreed to terms and conditions"
|
||||
>
|
||||
<span class="fas fa-check text-green-500 px-1" title="Agreed to terms and conditions"></span>
|
||||
Agreed
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-md variant-outline-warning"
|
||||
disabled={!$events_loc.auth__kv.person[event_presenter_obj.person_id_random]}
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View terms and conditions');
|
||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
$events_slct.presentation_obj = event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||
$events_slct.presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_loc.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
}
|
||||
title="View terms and conditions"
|
||||
>
|
||||
<span class="fas fa-times bg-red-500 text-white px-1 mx-1" title="Not agreed to terms and conditions"></span>
|
||||
Not yet agreed
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{event_presenter_obj.person_id_random}
|
||||
|
||||
<span class="fas fa-user"></span>
|
||||
{event_presenter_obj.full_name}
|
||||
|
||||
{#if $ae_loc.trusted_access && event_presenter_obj.email}
|
||||
<span class="fas fa-envelope"></span>
|
||||
<a
|
||||
href="mailto:{event_presenter_obj.email}"
|
||||
class="text-blue-500"
|
||||
>{event_presenter_obj.email}</a>
|
||||
|
||||
|
||||
{#if event_presenter_obj.agree}
|
||||
<span>
|
||||
<span class="fas fa-file"></span>
|
||||
{event_presenter_obj.file_count ? `(${event_presenter_obj.file_count}x files)` : '(0 files)'}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if event_presenter_obj.person_passcode}
|
||||
<span>
|
||||
<span class="fas fa-user-secret"></span>
|
||||
Passcode: {event_presenter_obj.person_passcode}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if event_presenter_obj.passcode}
|
||||
<span class="bg-red-100 p-1 rounded-md">
|
||||
<span class="fas fa-key"></span>
|
||||
Passcode: {event_presenter_obj.passcode}
|
||||
</span>
|
||||
{/if}
|
||||
{:else}
|
||||
<button
|
||||
class="btn btn-md variant-soft-primary"
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Email Access Link
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<!-- A button to copy the access link to the clipboard. -->
|
||||
<!-- Example: /events_pres_mgmt/session/Wh8UnJlbIA0?person_id=fV1dl_IJ0yY&person_pass=abc123 -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-primary"
|
||||
|
||||
use:clipboard={encodeURI(`${data.url.origin}/events_pres_mgmt/session/{$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}`)}
|
||||
>
|
||||
Copy Access Link
|
||||
</button>
|
||||
|
||||
<!-- on:click={() => {
|
||||
let person_id = event_presenter_obj.person_id_random;
|
||||
let person_pass = event_presenter_obj.person_passcode;
|
||||
let person_url = `/events_pres_mgmt/session/{$events_slct.event_session_id}?person_id=${person_id}&person_pass=${person_pass}`;
|
||||
let base_url = window.location.origin;
|
||||
console.log(`Copy the access link to the clipboard: ${person_url}`);
|
||||
clipboard.writeText(base_url+person_url);
|
||||
}} -->
|
||||
|
||||
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<p>Error: {error.message}</p>
|
||||
{/await}
|
||||
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
Nothing to show yet...
|
||||
{/if}
|
||||
{:catch error}
|
||||
<p>Error: {error.message}</p>
|
||||
{/await}
|
||||
</section>
|
||||
|
||||
|
||||
{/if}
|
||||
|
||||
</section>
|
||||
|
||||
{#if $events_loc.pres_mgmt?.show_content__agree_text}
|
||||
<section class="ae_quick_modal_container">
|
||||
<section class="ae_quick_popover">
|
||||
|
||||
<section class="ae_modal_scrollfix">
|
||||
<button
|
||||
on:click={
|
||||
() => {
|
||||
$events_loc.pres_mgmt.show_content__agree_text = null;
|
||||
}
|
||||
}
|
||||
class="btn btn-sm variant-soft-secondary float-right"
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Close
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
<h2 class="h3">
|
||||
Presenter Agreement for:<br>
|
||||
<strong>{$events_slct.presenter_obj.full_name} ({$events_slct.presenter_obj.email})</strong>
|
||||
</h2>
|
||||
|
||||
<Element_data_store
|
||||
ds_code="event_presenter_agree_text"
|
||||
ds_type="html"
|
||||
display="block"
|
||||
class_li="p-2"
|
||||
/>
|
||||
|
||||
<section class="p-2">
|
||||
<!-- Highlight the persons name, email, and that whole line. -->
|
||||
<p class="text-lg bg-yellow-100 p-2">
|
||||
<strong>{$events_slct.presenter_obj.full_name} ({$events_slct.presenter_obj.email})</strong> agrees to the following terms and conditions for the presentation:
|
||||
</p>
|
||||
<h3 class="h4">Title: "{$events_slct.presentation_obj.name}"</h3>
|
||||
<h3 class="h4">Opt-Out?</h3>
|
||||
<p>Speaker does not permit the use of presentation materials as described in section(s), above for: (please check for all that apply)</p>
|
||||
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-checkbox"
|
||||
>
|
||||
Audio Reproduction of Presentation
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-checkbox"
|
||||
>
|
||||
Video Reproduction of Presentation
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-checkbox"
|
||||
>
|
||||
Transcription and Publication of Presentation on LCI Website
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-checkbox"
|
||||
>
|
||||
Publication of Presentation on LCI Congress App
|
||||
</label>
|
||||
|
||||
|
||||
<h3 class="h4">Agree?</h3>
|
||||
<!-- Agree (agreement) means this presenter has agreed to the terms and conditions. -->
|
||||
<Element_ae_crud
|
||||
trigger_patch={ae_triggers.agree}
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_presenter'}
|
||||
object_id={$events_slct.presenter_obj?.event_presenter_id_random}
|
||||
field_name={'agree'}
|
||||
field_type={'button'}
|
||||
field_value={$events_slct.presenter_obj.agree}
|
||||
allow_null={false}
|
||||
hide_edit_btn={true}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
class_li={'m-1'}
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated event:`, e.detail);
|
||||
events_func.handle_load_ae_obj_id__presenter({api_cfg: $ae_api, presenter_id: $events_slct.presenter_id});
|
||||
}}
|
||||
>
|
||||
{#if !$events_slct.presenter_obj?.agree}
|
||||
Not Agreed:
|
||||
<span class="fas fa-question text-red-500 m-1"></span>
|
||||
<!-- <span class="fas fa-credit-card mx-1"></span> -->
|
||||
Waiting for agreement
|
||||
{:else}
|
||||
Agreed:
|
||||
<span class="fas fa-check text-green-500 m-1"></span>
|
||||
<span class="fas fa-check mx-1"></span>
|
||||
Marked as agreed
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$events_slct.presenter_obj.agree = !$events_slct.presenter_obj?.agree;
|
||||
ae_triggers.agree = true;
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
>
|
||||
{@html ($events_slct.presenter_obj?.agree ? '<span class="fas fa-sync m-1"></span> Not agreed?' : '<span class="fa fa-sync m-1"></span> Mark as agreed?')}
|
||||
</button>
|
||||
{/if}
|
||||
</Element_ae_crud>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<button
|
||||
on:click={
|
||||
() => {
|
||||
$events_loc.pres_mgmt.show_content__agree_text = null;
|
||||
}
|
||||
}
|
||||
class="btn btn-sm variant-soft-secondary float-right"
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Close
|
||||
</button>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
|
||||
<style lang="postcss">
|
||||
/* Use the div.ae_quick_modal_container to block background clicks when using the section.ae_quick_popover. */
|
||||
div.ae_quick_modal_container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 100;
|
||||
background-color: hsla(0, 0%, 0%, .5);
|
||||
}
|
||||
|
||||
/* The section.ae_quick_popover should be above the rest of the content and centered on the page. */
|
||||
section.ae_quick_popover {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 100;
|
||||
background-color: hsla(0, 0%, 100%, .95);
|
||||
padding: 1rem;
|
||||
border-radius: .5rem;
|
||||
box-shadow: 0 0 1rem hsla(0, 0%, 0%, .5);
|
||||
|
||||
min-height: 30%;
|
||||
min-width: 80%;
|
||||
}
|
||||
</style>
|
||||
73
src/routes/events_pres_mgmt/session/[slug]/+page.ts
Normal file
73
src/routes/events_pres_mgmt/session/[slug]/+page.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
console.log(`ae_events_pres_mgmt_event [slug] +page.ts start`);
|
||||
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
export async function load({ parent }) { // route
|
||||
// console.log(`ae_events_pres_mgmt_event +page.ts data.params:`, params);
|
||||
// console.log(`ae_events_pres_mgmt_event +page.ts data.route:`, route);
|
||||
// console.log(`ae_events_pres_mgmt_event +page.ts data.url:`, url);
|
||||
|
||||
let data = await parent();
|
||||
// console.log(`ae_events_pres_mgmt_event +page.ts data:`, data);
|
||||
|
||||
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 [slug] +page.ts: The account_id was not found in the data!!!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
data.ae_events_pres_mgmt_event_slug_page_ts = true;
|
||||
|
||||
// let param_slug_event_session_id = data.params.slug;
|
||||
|
||||
let event_session_id = data.params.slug;
|
||||
if (!event_session_id) {
|
||||
console.log(`events_pres_mgmt_event [slug] +layout.ts: The event_session_id was not found in the data.params.slug!!!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
ae_acct.slct.event_session_id = event_session_id;
|
||||
|
||||
let load_event_session_obj = events_func.handle_load_ae_obj_id__event_session({api_cfg: ae_acct.api, event_session_id: event_session_id, try_cache: false});
|
||||
|
||||
ae_acct.slct.event_session_obj = await load_event_session_obj;
|
||||
|
||||
let load_event_presentation_obj_li = await events_func.handle_load_ae_obj_li__event_presentation({
|
||||
api_cfg: ae_acct.api,
|
||||
event_session_id: event_session_id,
|
||||
params: {enabled: 'all', qry__limit: 50},
|
||||
try_cache: false
|
||||
})
|
||||
.then((event_presentation_obj_li) => {
|
||||
console.log(`event_presentation_obj_li = `, event_presentation_obj_li);
|
||||
for (let index = 0; index < event_presentation_obj_li.length; index++) {
|
||||
let event_presentation_obj = event_presentation_obj_li[index];
|
||||
let event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
|
||||
let load_event_presenter_obj_li = events_func.handle_load_ae_obj_li__event_presenter({
|
||||
api_cfg: ae_acct.api,
|
||||
event_presentation_id: event_presentation_id,
|
||||
params: {enabled: 'all', qry__limit: 15},
|
||||
try_cache: false
|
||||
});
|
||||
console.log(`load_event_presenter_obj_li = `, load_event_presenter_obj_li);
|
||||
event_presentation_obj_li[index].event_presenter_li = load_event_presenter_obj_li;
|
||||
// ae_acct.slct.event_presentation_obj_li[index].event_presenter_obj_li = load_event_presenter_obj_li;
|
||||
}
|
||||
|
||||
// ae_acct.slct.event_presentation_obj_li = event_presentation_obj_li;
|
||||
|
||||
return event_presentation_obj_li;
|
||||
});
|
||||
console.log(`load_event_presentation_obj_li = `, load_event_presentation_obj_li);
|
||||
ae_acct.slct.event_presentation_obj_li = load_event_presentation_obj_li;
|
||||
|
||||
// WARNING: Precaution against shared data between sites and presentations.
|
||||
data[account_id] = ae_acct;
|
||||
|
||||
return data;
|
||||
}
|
||||
Reference in New Issue
Block a user