Making progress with the new locations page and devices related.
This commit is contained in:
@@ -1,37 +1,40 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
export let data: any;
|
||||
let log_lvl = 2;
|
||||
let log_lvl = 0;
|
||||
// console.log(`ae_events_pres_mgmt event [event_id] +page.svelte data:`, data);
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
// import { browser } from '$app/environment';
|
||||
// import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import type { key_val } from '$lib/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
// import Comp_event_session_obj_li from '../../events_pres_mgmt/ae_comp__event_session_obj_li.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
import { db_events } from "$lib/db_events";
|
||||
// import { liveQuery } from "dexie";
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
// import { db_events } from "$lib/db_events";
|
||||
import { ae_snip, 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';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
|
||||
import Event_page_menu from '../event_page_menu.svelte';
|
||||
// import Event_page_menu from '../event_page_menu.svelte';
|
||||
|
||||
|
||||
// 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);
|
||||
if (log_lvl) {
|
||||
console.log(`ae_acct = `, ae_acct);
|
||||
}
|
||||
|
||||
console.log(`event_id layout A: ${data.params.event_id}`);
|
||||
console.log(`event_id layout B: ${ae_acct.slct.event_id}`);
|
||||
console.log(`event_id layout C: ${$events_slct.event_id}`);
|
||||
if (log_lvl > 1) {
|
||||
console.log(`event_id layout A: ${data.params.event_id}`);
|
||||
console.log(`event_id layout B: ${ae_acct.slct.event_id}`);
|
||||
console.log(`event_id layout C: ${$events_slct.event_id}`);
|
||||
}
|
||||
|
||||
// $: event_id = data.params.event_id;
|
||||
// console.log(`event_id layout D: ${event_id}`);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import Comp_event_session_obj_li from '../../events_pres_mgmt/ae_comp__event_session_obj_li.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
import { db_events } from "$lib/db_events";
|
||||
import { ae_snip, 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';
|
||||
@@ -80,7 +80,7 @@ $: lq__event_location_obj_li = liveQuery(async () => {
|
||||
.where('event_id_random')
|
||||
.equals($events_slct.event_id)
|
||||
.sortBy('name')
|
||||
|
||||
;
|
||||
return results;
|
||||
});
|
||||
|
||||
@@ -481,6 +481,7 @@ max-w-max -->
|
||||
<!-- Clear text -->
|
||||
</button>
|
||||
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Search for a session"
|
||||
@@ -493,7 +494,6 @@ max-w-max -->
|
||||
}
|
||||
}}
|
||||
autofocus
|
||||
suggest="off"
|
||||
data-ignore="true"
|
||||
/>
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<script lang="ts">
|
||||
// Imports
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
|
||||
// Exports
|
||||
export let log_lvl: number = 0;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let link_to_type: string;
|
||||
export let link_to_id: string;
|
||||
export let lq__event_device_obj_li: any;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
// Functions and Logic
|
||||
</script>
|
||||
|
||||
|
||||
<div
|
||||
class="float-right flex flex-row items-center"
|
||||
>
|
||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Add Device');
|
||||
if (!confirm('Add a new device to the event? You will be able to edit the details after the device is created.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let device_data = {
|
||||
event_id_random: $events_slct.event_id,
|
||||
name: 'TEMP Device Name',
|
||||
enable: true,
|
||||
}
|
||||
|
||||
events_func.create_ae_obj__event_device({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
data_kv: device_data,
|
||||
log_lvl: log_lvl,
|
||||
})
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning"
|
||||
>
|
||||
<span class="fas fa-plus mx-1"></span>
|
||||
Add Device
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<section class="ae_comp event_device_obj_li {container_class_li}">
|
||||
|
||||
|
||||
<h3 class="h5">
|
||||
Devices:
|
||||
<span class="font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||
class:hidden={!$lq__event_device_obj_li?.length}
|
||||
title="Devices: {$lq__event_device_obj_li?.length ?? 'None'}"
|
||||
>
|
||||
<span class="fas fa-chalkboard-teacher m-1"></span>
|
||||
{@html ($lq__event_device_obj_li?.length ? `${$lq__event_device_obj_li?.length}×` : '')}
|
||||
</span>
|
||||
|
||||
{#if !$lq__event_device_obj_li?.length}
|
||||
<span class="text-sm text-gray-500 bg-gray-100 p-1 rounded-md border border-gray-200"
|
||||
>
|
||||
<span class="fas fa-exclamation-triangle mx-1"></span>
|
||||
No devices available.
|
||||
</span>
|
||||
{/if}
|
||||
</h3>
|
||||
|
||||
<!-- Show devices for this LiveQuery -->
|
||||
{#if $lq__event_device_obj_li?.length}
|
||||
<ul
|
||||
class="space-y-4 p-4 m-2 bg-gray-100 rounded-md"
|
||||
>
|
||||
{#each $lq__event_device_obj_li as event_device_obj}
|
||||
<li
|
||||
class="space-y-2 border border-gray-200 p-2 rounded-md"
|
||||
>
|
||||
|
||||
<div class="float-right space-2 flex flex-row items-center">
|
||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Add Session');
|
||||
if (!confirm('Add a new session to the device? You will be able to edit their details after the session record is created.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let session_data = {
|
||||
event_id_random: $events_slct.event_id,
|
||||
event_device_id_random: event_device_obj?.event_device_id_random,
|
||||
name: 'TEMP Session Name',
|
||||
enable: true,
|
||||
}
|
||||
|
||||
events_func.create_ae_obj__event_session({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
data_kv: session_data,
|
||||
log_lvl: log_lvl,
|
||||
})
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning"
|
||||
>
|
||||
<span class="fas fa-plus mx-1"></span>
|
||||
Add Session
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<h4 class="h5 rounded-md p-2 bg-gray-200">
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_device'}
|
||||
object_id={event_device_obj?.event_device_id_random}
|
||||
field_name={'name'}
|
||||
field_type={'text'}
|
||||
field_value={event_device_obj?.name}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access || !$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_device({
|
||||
api_cfg: $ae_api, event_device_id: event_device_obj.event_device_id_random, log_lvl: 1
|
||||
})
|
||||
.then(function (load_results) {
|
||||
})
|
||||
.then(function (load_results) {
|
||||
// $events_trigger = 'load__event_device_obj_id';
|
||||
// $events_trig_kv['event_device_id'] = event_device_obj.event_device_id_random;
|
||||
});
|
||||
}}
|
||||
>
|
||||
<!-- <strong class="text-sm">Name/Title:</strong> -->
|
||||
"{event_device_obj?.name}"
|
||||
</Element_ae_crud>
|
||||
<!-- "{event_device_obj.name}" -->
|
||||
{#if event_device_obj?.code}
|
||||
<span class="text-sm text-gray-500 bg-yellow-100 p-1 rounded-md border border-yellow-200"
|
||||
title="Device code {event_device_obj?.code}"
|
||||
>
|
||||
<span class="fas fa-barcode"></span>
|
||||
{event_device_obj?.code ?? ''}
|
||||
</span>
|
||||
{/if}
|
||||
</h4>
|
||||
|
||||
<div
|
||||
class:hidden={!$events_loc.pres_mgmt.show_content__device_description}
|
||||
>
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_device'}
|
||||
object_id={event_device_obj?.event_device_id_random}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
field_value={event_device_obj?.description}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access || !$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
textarea_rows={15}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_device({api_cfg: $ae_api, event_device_id: event_device_obj.event_device_id_random, log_lvl: 1});
|
||||
}}
|
||||
>
|
||||
<strong class="text-sm">
|
||||
Description:
|
||||
</strong>
|
||||
|
||||
{#if event_device_obj?.description}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Show/Hide Description');
|
||||
if ($events_sess.pres_mgmt.show_content__device_description == event_device_obj.event_device_id_random) {
|
||||
$events_sess.pres_mgmt.show_content__device_description = null;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_device_id = null;
|
||||
} else {
|
||||
$events_sess.pres_mgmt.show_content__device_description = event_device_obj.event_device_id_random;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_device_id = event_device_obj.event_device_id_random;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-soft-surface hover:variant-filled-surface text-xs"
|
||||
>
|
||||
{#if $events_sess.pres_mgmt.show_content__device_description == event_device_obj.event_device_id_random}
|
||||
<span class="fas fa-eye-slash mx-1"></span>
|
||||
<span>Hide Description</span>
|
||||
{:else}
|
||||
<span class="fas fa-eye mx-1"></span>
|
||||
<span>Show</span>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={$events_sess.pres_mgmt.show_content__device_description !== event_device_obj.event_device_id_random}
|
||||
>{event_device_obj.description}</pre>
|
||||
|
||||
{:else}
|
||||
{@html ae_snip.html__not_set}
|
||||
{/if}
|
||||
<!-- {:else}
|
||||
<div class="text-sm text-gray-500 bg-gray-100 p-1 rounded-md border border-gray-200"
|
||||
class:hidden={!$ae_loc.administrator_access}
|
||||
>
|
||||
<span class="fas fa-exclamation-triangle mx-1"></span>
|
||||
No description provided.
|
||||
</div>
|
||||
{/if} -->
|
||||
</Element_ae_crud>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
<!-- <p class:hidden={display_mode != 'default'}>
|
||||
No devices available to show at this time
|
||||
</p> -->
|
||||
{/if}
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,57 @@
|
||||
<script lang="ts">
|
||||
// Imports
|
||||
import Comp_event_device_obj_li from '././ae_comp__event_device_obj_li.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { db_events } from "$lib/db_events";
|
||||
|
||||
// Exports
|
||||
export let log_lvl: number = 2;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let event_device_id_random_li: Array<string> = [];
|
||||
export let link_to_type: string;
|
||||
export let link_to_id: string;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
let dq__where_type_id_val: string = `${link_to_type}_id_random`;
|
||||
let dq__where_eq_id_val: string = link_to_id;
|
||||
|
||||
// Functions and Logic
|
||||
$: lq__event_device_obj_li = liveQuery(async () => {
|
||||
if (link_to_type && link_to_id) {
|
||||
let results = await db_events.devices
|
||||
.where(dq__where_type_id_val)
|
||||
.equals(dq__where_eq_id_val)
|
||||
.sortBy('name')
|
||||
|
||||
return results;
|
||||
} else if (event_device_id_random_li.length > 0) {
|
||||
let results = await db_events.devices
|
||||
.bulkGet(event_device_id_random_li);
|
||||
|
||||
return results;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<Comp_event_device_obj_li
|
||||
container_class_li={container_class_li}
|
||||
link_to_type={link_to_type}
|
||||
link_to_id={link_to_id}
|
||||
lq__event_device_obj_li={lq__event_device_obj_li}
|
||||
log_lvl={log_lvl}
|
||||
>
|
||||
</Comp_event_device_obj_li>
|
||||
@@ -7,20 +7,20 @@ let log_lvl = 0;
|
||||
// Imports
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
// import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
import { db_events } from "$lib/db_events";
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Comp_event_files_upload from '../../../../events_pres_mgmt/ae_comp__event_files_upload.svelte';
|
||||
import Comp_event_session_obj_li from '../../../../events_pres_mgmt/ae_comp__event_session_obj_li.svelte';
|
||||
@@ -65,24 +65,26 @@ if (!$events_sess.pres_mgmt) {
|
||||
// $events_sess.pres_mgmt.show_content__agree_text = false;
|
||||
// $events_sess.pres_mgmt.show_content__presenter_start = false;
|
||||
|
||||
let lq__event_obj = liveQuery(
|
||||
() => db_events.events.get($events_slct.event_id)
|
||||
);
|
||||
$: lq__event_obj = liveQuery(async () => {
|
||||
let results = await db_events.events
|
||||
.get($events_slct.event_id);
|
||||
return results;
|
||||
});
|
||||
|
||||
let lq__event_location_obj = liveQuery(
|
||||
() => db_events.locations.get(ae_acct.slct.event_location_id)
|
||||
);
|
||||
$: lq__event_location_obj = liveQuery(async () => {
|
||||
let results = await db_events.locations
|
||||
.get(ae_acct.slct.event_location_id);
|
||||
return results;
|
||||
});
|
||||
|
||||
let lq__event_session_obj_li = liveQuery(
|
||||
() => db_events.sessions
|
||||
$: lq__event_session_obj_li = liveQuery(async () => {
|
||||
let results = await db_events.sessions
|
||||
.where('event_location_id')
|
||||
.equals(ae_acct.slct.event_location_id)
|
||||
.sortBy('start_datetime')
|
||||
);
|
||||
|
||||
// let lq__auth__event_presenter_obj = liveQuery(
|
||||
// () => db_events.presenters.get($events_loc.auth__person.presenter_id ?? null)
|
||||
// );
|
||||
;
|
||||
return results;
|
||||
});
|
||||
|
||||
$slct.person_obj_kv = {}; // This is intended for the POC lookup list when generated.
|
||||
|
||||
|
||||
143
src/routes/events/[event_id]/locations/+page.svelte
Normal file
143
src/routes/events/[event_id]/locations/+page.svelte
Normal file
@@ -0,0 +1,143 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
export let data: any;
|
||||
let log_lvl = 0;
|
||||
// console.log(`ae_events_pres_mgmt event [slug] +page.svelte data:`, data);
|
||||
|
||||
// Imports
|
||||
import { Modal } from 'flowbite-svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { core_func } from '$lib/ae_core_functions';
|
||||
import { db_events } from "$lib/db_events";
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Comp_event_location_obj_li from './ae_comp__event_location_obj_li.svelte';
|
||||
import Locations_page_menu from './locations_page_menu.svelte';
|
||||
// import Sign_in_out from './../../sign_in_out.svelte';
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
|
||||
// Variables
|
||||
if (browser) {
|
||||
console.log('Browser environment detected.');
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
$ae_loc.url_origin = data.url.origin;
|
||||
|
||||
$events_slct.event_id = ae_acct.slct.event_id;
|
||||
|
||||
$: lq__event_obj = liveQuery(async () => {
|
||||
let results = await db_events.events.get($events_slct.event_id);
|
||||
return results;
|
||||
});
|
||||
|
||||
$: lq__event_location_obj_li = liveQuery(async () => {
|
||||
let results = await db_events.locations
|
||||
.where('event_id')
|
||||
.equals(ae_acct.slct.event_id)
|
||||
.sortBy('name')
|
||||
;
|
||||
return results;
|
||||
});
|
||||
|
||||
// Functions and Logic
|
||||
onMount(() => {
|
||||
console.log('Events Location [slug]: +page.svelte');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<svelte:head>
|
||||
<title>
|
||||
Locations: {ae_util.shorten_string({string: $lq__event_obj?.name ?? 'Loading...', max_length: 12})} ({$lq__event_obj?.event_id ?? ''}) - Pres Mgmt - {$events_loc?.title}
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
|
||||
<section
|
||||
class="
|
||||
ae_events_pres_mgmt_event_location
|
||||
md:container
|
||||
flex flex-col gap-1
|
||||
items-center
|
||||
justify-start
|
||||
mx-auto
|
||||
py-1 px-2 pb-16
|
||||
h-full
|
||||
min-w-full
|
||||
max-w-max
|
||||
"
|
||||
>
|
||||
|
||||
<Locations_page_menu
|
||||
lq__event_obj={lq__event_obj}
|
||||
/>
|
||||
|
||||
{#if !$lq__event_location_obj_li}
|
||||
|
||||
<div>
|
||||
<span class="fas fa-spinner fa-spin m-1"></span>
|
||||
<span>Loading locations...</span>
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
|
||||
<h2 class="h2 text-center rounded-md p-1 px-2 bg-gray-300 flex flex-row gap-0.25 items-center justify-between w-full">
|
||||
<span
|
||||
class="flex flex-row gap-1 items-center"
|
||||
>
|
||||
<!-- <span class="fas fa-calendar-day m-1"></span> -->
|
||||
<span class="fas fa-map-marked m-1"></span>
|
||||
Locations/Rooms
|
||||
<!-- Button to toggle between the regular location view and managing locations??? -->
|
||||
</span>
|
||||
<!-- Locations for: -->
|
||||
{#if $lq__event_obj?.cfg_json?.short_name}
|
||||
{@html $lq__event_obj?.cfg_json.short_name ?? ae_snip.html__not_set}
|
||||
{:else}
|
||||
{@html $lq__event_obj?.name ?? ae_snip.html__not_set}
|
||||
{/if}
|
||||
</h2>
|
||||
|
||||
<Element_data_store
|
||||
ds_code="events__pres_mgmt__locations_msg"
|
||||
ds_name="Default: Events - Pres Mgmt Locations Message"
|
||||
ds_type="html"
|
||||
for_type="event"
|
||||
for_id={$lq__event_obj?.event_id}
|
||||
class_li="w-full max-w-screen-lg text-lg text-blue-500 font-bold text-center p-1 m-auto border border-blue-200 rounded-md bg-blue-100 space-y-2"
|
||||
hide={!$ae_loc.manager_access || $events_loc.pres_mgmt.hide__locations_msg}
|
||||
show_edit={false}
|
||||
show_edit_btn={true}
|
||||
/>
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
<Comp_event_location_obj_li
|
||||
lq__event_location_obj_li={lq__event_location_obj_li}
|
||||
/>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style lang="postcss">
|
||||
</style>
|
||||
@@ -0,0 +1,298 @@
|
||||
<script lang="ts">
|
||||
// Imports
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Comp_event_session_obj_li from '../../../events_pres_mgmt/ae_comp__event_session_obj_li_wrapper.svelte';
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
import Element_manage_event_file_li_wrap from '$lib/element_manage_event_file_li_all.svelte';
|
||||
import Comp_event_device_obj_li from './../device/ae_comp__event_device_obj_li_wrapper.svelte';
|
||||
|
||||
// Exports
|
||||
export let log_lvl: number = 0;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let link_to_type: string;
|
||||
export let link_to_id: string;
|
||||
export let lq__event_location_obj_li: any;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
// Functions and Logic
|
||||
</script>
|
||||
|
||||
|
||||
<div
|
||||
class="float-right flex flex-row items-center"
|
||||
>
|
||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Add Location');
|
||||
if (!confirm('Add a new location to the event? You will be able to edit the details after the location is created.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let location_data = {
|
||||
event_id_random: $events_slct.event_id,
|
||||
name: 'TEMP Location Name',
|
||||
enable: true,
|
||||
}
|
||||
|
||||
events_func.create_ae_obj__event_location({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
data_kv: location_data,
|
||||
log_lvl: log_lvl,
|
||||
})
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning"
|
||||
>
|
||||
<span class="fas fa-plus mx-1"></span>
|
||||
Add Location
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<section class="ae_comp event_location_obj_li {container_class_li}">
|
||||
|
||||
|
||||
<h3 class="h5">
|
||||
Locations:
|
||||
<span class="font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||
class:hidden={!$lq__event_location_obj_li?.length}
|
||||
title="Locations: {$lq__event_location_obj_li?.length ?? 'None'}"
|
||||
>
|
||||
<span class="fas fa-chalkboard-teacher m-1"></span>
|
||||
{@html ($lq__event_location_obj_li?.length ? `${$lq__event_location_obj_li?.length}×` : '')}
|
||||
</span>
|
||||
|
||||
{#if !$lq__event_location_obj_li?.length}
|
||||
<span class="text-sm text-gray-500 bg-gray-100 p-1 rounded-md border border-gray-200"
|
||||
>
|
||||
<span class="fas fa-exclamation-triangle mx-1"></span>
|
||||
No locations available.
|
||||
</span>
|
||||
{/if}
|
||||
</h3>
|
||||
|
||||
<!-- Show locations for this LiveQuery -->
|
||||
{#if $lq__event_location_obj_li?.length}
|
||||
<ul
|
||||
class="space-y-4 p-4 m-2 bg-gray-100 rounded-md"
|
||||
>
|
||||
{#each $lq__event_location_obj_li as event_location_obj}
|
||||
<li
|
||||
class="space-y-2 border border-gray-200 p-2 rounded-md"
|
||||
>
|
||||
|
||||
<div class="float-right space-2 flex flex-row items-center">
|
||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Add Session');
|
||||
if (!confirm('Add a new session to the location? You will be able to edit their details after the session record is created.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let session_data = {
|
||||
event_id_random: $events_slct.event_id,
|
||||
event_location_id_random: event_location_obj?.event_location_id_random,
|
||||
name: 'TEMP Session Name',
|
||||
enable: true,
|
||||
}
|
||||
|
||||
events_func.create_ae_obj__event_session({
|
||||
api_cfg: $ae_api,
|
||||
event_id: $events_slct.event_id,
|
||||
data_kv: session_data,
|
||||
log_lvl: log_lvl,
|
||||
})
|
||||
}}
|
||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning"
|
||||
>
|
||||
<span class="fas fa-plus mx-1"></span>
|
||||
Add Session
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<h4 class="h5 rounded-md p-2 bg-gray-200">
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id_random}
|
||||
field_name={'name'}
|
||||
field_type={'text'}
|
||||
field_value={event_location_obj?.name}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access || !$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_location({
|
||||
api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id_random, log_lvl: 1
|
||||
})
|
||||
.then(function (load_results) {
|
||||
})
|
||||
.then(function (load_results) {
|
||||
// $events_trigger = 'load__event_location_obj_id';
|
||||
// $events_trig_kv['event_location_id'] = event_location_obj.event_location_id_random;
|
||||
});
|
||||
}}
|
||||
>
|
||||
<!-- <strong class="text-sm">Name/Title:</strong> -->
|
||||
"{event_location_obj?.name}"
|
||||
</Element_ae_crud>
|
||||
<!-- "{event_location_obj.name}" -->
|
||||
{#if event_location_obj?.code}
|
||||
<span class="text-sm text-gray-500 bg-yellow-100 p-1 rounded-md border border-yellow-200"
|
||||
title="Location code {event_location_obj?.code}"
|
||||
>
|
||||
<span class="fas fa-barcode"></span>
|
||||
{event_location_obj?.code ?? ''}
|
||||
</span>
|
||||
{/if}
|
||||
</h4>
|
||||
|
||||
<div
|
||||
class:hidden={!$events_loc.pres_mgmt.show_content__location_description}
|
||||
>
|
||||
<Element_ae_crud
|
||||
api_cfg={$ae_api}
|
||||
object_type={'event_location'}
|
||||
object_id={event_location_obj?.event_location_id_random}
|
||||
field_name={'description'}
|
||||
field_type={'textarea'}
|
||||
field_value={event_location_obj?.description}
|
||||
allow_null={false}
|
||||
hide_edit_btn={!$ae_loc.trusted_access || !$ae_loc.edit_mode}
|
||||
outline_element={false}
|
||||
show_crud={false}
|
||||
display_inline={true}
|
||||
display_block_edit={true}
|
||||
textarea_rows={15}
|
||||
class_li={''}
|
||||
on:ae_crud_updated={e => {
|
||||
console.log(`ae_crud_updated:`, e.detail);
|
||||
|
||||
events_func.load_ae_obj_id__event_location({api_cfg: $ae_api, event_location_id: event_location_obj.event_location_id_random, log_lvl: 1});
|
||||
}}
|
||||
>
|
||||
<strong class="text-sm">
|
||||
Description:
|
||||
</strong>
|
||||
|
||||
{#if event_location_obj?.description}
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('Show/Hide Description');
|
||||
if ($events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random) {
|
||||
$events_sess.pres_mgmt.show_content__location_description = null;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_location_id = null;
|
||||
} else {
|
||||
$events_sess.pres_mgmt.show_content__location_description = event_location_obj.event_location_id_random;
|
||||
|
||||
// Was testing with LiveQuery
|
||||
$events_slct.event_location_id = event_location_obj.event_location_id_random;
|
||||
}
|
||||
}}
|
||||
class="btn btn-sm variant-soft-surface hover:variant-filled-surface text-xs"
|
||||
>
|
||||
{#if $events_sess.pres_mgmt.show_content__location_description == event_location_obj.event_location_id_random}
|
||||
<span class="fas fa-eye-slash mx-1"></span>
|
||||
<span>Hide Description</span>
|
||||
{:else}
|
||||
<span class="fas fa-eye mx-1"></span>
|
||||
<span>Show</span>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={$events_sess.pres_mgmt.show_content__location_description !== event_location_obj.event_location_id_random}
|
||||
>{event_location_obj.description}</pre>
|
||||
|
||||
{:else}
|
||||
{@html ae_snip.html__not_set}
|
||||
{/if}
|
||||
<!-- {:else}
|
||||
<div class="text-sm text-gray-500 bg-gray-100 p-1 rounded-md border border-gray-200"
|
||||
class:hidden={!$ae_loc.administrator_access}
|
||||
>
|
||||
<span class="fas fa-exclamation-triangle mx-1"></span>
|
||||
No description provided.
|
||||
</div>
|
||||
{/if} -->
|
||||
</Element_ae_crud>
|
||||
</div>
|
||||
|
||||
<!-- Show devices for this location -->
|
||||
{#if event_location_obj?.event_location_id_random}
|
||||
<Comp_event_device_obj_li
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
event_device_id_random_li={[]}
|
||||
log_lvl={log_lvl}
|
||||
>
|
||||
</Comp_event_device_obj_li>
|
||||
{/if}
|
||||
|
||||
<!-- Show sessions for this location -->
|
||||
<!-- {#if event_location_obj?.event_location_id_random}
|
||||
<Comp_event_session_obj_li
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
event_session_id_random_li={[]}
|
||||
log_lvl={log_lvl}
|
||||
>
|
||||
</Comp_event_session_obj_li>
|
||||
{/if} -->
|
||||
|
||||
|
||||
<!-- Show files for this location -->
|
||||
<!-- <Element_manage_event_file_li_wrap
|
||||
link_to_type={'event_location'}
|
||||
link_to_id={event_location_obj?.event_location_id_random}
|
||||
allow_basic={$events_loc.trusted_access}
|
||||
allow_moderator={$events_loc.trusted_access}
|
||||
container_class_li={''}
|
||||
/> -->
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{:else}
|
||||
<!-- <p class:hidden={display_mode != 'default'}>
|
||||
No locations available to show at this time
|
||||
</p> -->
|
||||
{/if}
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,137 @@
|
||||
<script lang="ts">
|
||||
// export let data: any;
|
||||
export let log_lvl = 0;
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
|
||||
// export let event_location_id: string;
|
||||
export let lq__event_obj: any;
|
||||
// export let lq__auth__event_presenter_obj: any;
|
||||
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- New standard page specific menu 2024-08-01 -->
|
||||
<div
|
||||
class="pres_mgmt__location_menu {ae_snip.classes__events_pres_mgmt_menu}"
|
||||
class:border-gray-100={!$events_loc.pres_mgmt.show_menu__location}
|
||||
>
|
||||
|
||||
<!-- BEGIN: The menu button options -->
|
||||
<div
|
||||
class="flex flex-row flex-wrap gap-1 items-center justify-around w-full">
|
||||
|
||||
<span
|
||||
class="ae_menu__navigation_options flex flex-row items-center justify-around"
|
||||
>
|
||||
<a href="/events/{$lq__event_obj?.event_id}" class="{ae_snip.classes__events_pres_mgmt_menu__button}">
|
||||
<span class="fas fa-arrow-left m-1"></span>
|
||||
Back to Session Search
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="ae_menu__object_options flex flex-row items-center justify-around"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
if ($events_loc.pres_mgmt.show_menu__location == 'options') {
|
||||
$events_loc.pres_mgmt.show_menu__location = null;
|
||||
} else {
|
||||
$events_loc.pres_mgmt.show_menu__location = 'options';
|
||||
}
|
||||
}}
|
||||
class="{ae_snip.classes__events_pres_mgmt_menu__button}"
|
||||
class:variant-filled-secondary={$events_loc.pres_mgmt.show_menu__location == 'options'}
|
||||
class:variant-glass-secondary={$events_loc.pres_mgmt.show_menu__location != 'options'}
|
||||
class:hidden={!$ae_loc.trusted_access}
|
||||
title="Options for the location"
|
||||
>
|
||||
<span class="fas fa-cog m-1"></span>
|
||||
{#if $events_loc.pres_mgmt.show_menu__location == 'options'}
|
||||
Hide
|
||||
{:else}
|
||||
Show
|
||||
{/if}
|
||||
Options?
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
if ($events_loc.pres_mgmt.show_menu__location == 'help') {
|
||||
$events_loc.pres_mgmt.show_menu__location = null;
|
||||
} else {
|
||||
$events_loc.pres_mgmt.show_menu__location = 'help';
|
||||
}
|
||||
}}
|
||||
class="{ae_snip.classes__events_pres_mgmt_menu__button}"
|
||||
class:variant-filled-secondary={$events_loc.pres_mgmt.show_menu__location == 'help'}
|
||||
class:variant-glass-secondary={$events_loc.pres_mgmt.show_menu__location != 'help'}
|
||||
title="Help and information about the location"
|
||||
>
|
||||
<span class="fas fa-question-circle m-1"></span>
|
||||
{#if $events_loc.pres_mgmt.show_menu__location == 'help'}
|
||||
Hide Help?
|
||||
{:else}
|
||||
Help?
|
||||
{/if}
|
||||
</button>
|
||||
</span>
|
||||
|
||||
</div> <!-- END: The menu button options -->
|
||||
|
||||
<!-- BEGIN: The expanded menu area for information and options -->
|
||||
<div
|
||||
class="flex flex-row items-center justify-around w-full bg-blue-100 hover:bg-blue-200 border border-blue-200 hover:border-blue-400 p-2 rounded-md"
|
||||
class:hidden={$events_loc.pres_mgmt.show_menu__location != 'options'}
|
||||
>
|
||||
|
||||
Not much here yet...
|
||||
|
||||
</div> <!-- END: The expanded menu area for information and options -->
|
||||
|
||||
|
||||
<Element_data_store
|
||||
ds_code="events__pres_mgmt__location_help"
|
||||
ds_name="Default: Events - Pres Mgmt Session Help"
|
||||
ds_type="html"
|
||||
for_type="event"
|
||||
for_id={$lq__event_obj?.event_id}
|
||||
class_li="bg-yellow-100 border border-yellow-400 p-2 rounded-md max-w-xl"
|
||||
show_edit={false}
|
||||
show_edit_btn={true}
|
||||
hide={$events_loc.pres_mgmt.show_menu__location != 'help'}
|
||||
/>
|
||||
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
$events_loc.pres_mgmt.show_menu__location = !$events_loc.pres_mgmt.show_menu__location;
|
||||
}}
|
||||
class="btn btn-sm mx-1 variant-ghost-error hover:variant-filled-error"
|
||||
class:hidden={!$events_loc.pres_mgmt.show_menu__location}
|
||||
title="Collapse the expanded menu"
|
||||
>
|
||||
<span class="fas fa-chevron-up m-1"></span>
|
||||
{#if $events_loc.pres_mgmt.show_menu__location}
|
||||
Hide
|
||||
<!-- Collapse -->
|
||||
{:else}
|
||||
Show
|
||||
{/if}
|
||||
<!-- Menu? -->
|
||||
</button>
|
||||
</div>
|
||||
</div> <!-- End of the new standard page specific menu -->
|
||||
@@ -15,16 +15,17 @@ import { events_func } from '$lib/ae_events_functions';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
|
||||
// Exports
|
||||
export let log_lvl: number = 0;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let link_to_type: string;
|
||||
export let link_to_id: string;
|
||||
export let lq__event_presenter_obj_li: any;
|
||||
export let log_lvl: number = 0;
|
||||
|
||||
// if (log_lvl) {
|
||||
// console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
// }
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let data: any;
|
||||
// export let data: any;
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
@@ -12,8 +12,8 @@ import Comp__pres_mgmt_menu_nav from './ae_comp__events_menu_nav.svelte';
|
||||
|
||||
export let lq__event_obj: any;
|
||||
|
||||
let ae_tmp: key_val = {};
|
||||
let ae_triggers: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
</script>
|
||||
|
||||
@@ -180,22 +180,6 @@ let ae_triggers: key_val = {};
|
||||
<select
|
||||
id="qry_limit__presenters"
|
||||
bind:value={$events_loc.pres_mgmt.qry_limit__presenters}
|
||||
on:change={() => {
|
||||
// search__event_presenter({
|
||||
// api_cfg: $ae_api,
|
||||
// event_id: $events_slct.event_id,
|
||||
// agree: true,
|
||||
// biography: null,
|
||||
// ft_search_str: '',
|
||||
// lk_search_str: '',
|
||||
// params: {
|
||||
// 'qry__enabled': 'enabled',
|
||||
// 'qry__hidden': 'not_hidden',
|
||||
// 'qry__limit': $events_loc.pres_mgmt.qry_limit__presenters,},
|
||||
// try_cache: false,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
}}
|
||||
class="select w-20 text-sm"
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
@@ -219,22 +203,6 @@ let ae_triggers: key_val = {};
|
||||
<select
|
||||
id="qry_limit__sessions"
|
||||
bind:value={$events_loc.pres_mgmt.qry_limit__sessions}
|
||||
on:change={() => {
|
||||
// search__event_presenter({
|
||||
// api_cfg: $ae_api,
|
||||
// event_id: $events_slct.event_id,
|
||||
// agree: true,
|
||||
// biography: null,
|
||||
// ft_search_str: '',
|
||||
// lk_search_str: '',
|
||||
// params: {
|
||||
// 'qry__enabled': 'enabled',
|
||||
// 'qry__hidden': 'not_hidden',
|
||||
// 'qry__limit': $events_loc.pres_mgmt.qry_limit__sessions,},
|
||||
// try_cache: false,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
}}
|
||||
class="select w-20 text-sm"
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
@@ -258,22 +226,6 @@ let ae_triggers: key_val = {};
|
||||
<select
|
||||
id="qry_limit__files"
|
||||
bind:value={$events_loc.pres_mgmt.qry_limit__files}
|
||||
on:change={() => {
|
||||
// search__event_presenter({
|
||||
// api_cfg: $ae_api,
|
||||
// event_id: $events_slct.event_id,
|
||||
// agree: true,
|
||||
// biography: null,
|
||||
// ft_search_str: '',
|
||||
// lk_search_str: '',
|
||||
// params: {
|
||||
// 'qry__enabled': 'enabled',
|
||||
// 'qry__hidden': 'not_hidden',
|
||||
// 'qry__limit': $events_loc.pres_mgmt.qry_limit__files,},
|
||||
// try_cache: false,
|
||||
// log_lvl: log_lvl,
|
||||
// });
|
||||
}}
|
||||
class="select w-20 text-sm"
|
||||
>
|
||||
<option value={25}>25</option>
|
||||
|
||||
@@ -15,11 +15,13 @@ import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv }
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
// Exports
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let link_to_type: string;
|
||||
// export let link_to_id: string;
|
||||
export let lq__event_session_obj_li: any;
|
||||
export let log_lvl: number = 0;
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
|
||||
export let link_to_type: null|string;
|
||||
export let link_to_id: null|string;
|
||||
export let lq__event_session_obj_li: any;
|
||||
|
||||
export let hide__session_location: boolean = false;
|
||||
export let hide__session_poc: boolean = false;
|
||||
@@ -31,7 +33,9 @@ export let show__session_presentations: boolean = false;
|
||||
// export let allow_basic: boolean = false;
|
||||
// export let allow_moderator: boolean = false;
|
||||
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<script lang="ts">
|
||||
// Imports
|
||||
import Comp_event_session_obj_li from './ae_comp__event_session_obj_li.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
import { db_events } from "$lib/db_events";
|
||||
|
||||
// Exports
|
||||
export let container_class_li: string|Array<string> = [];
|
||||
// export let display_mode: string = 'default'; // 'default', 'compact', 'minimal', 'launcher'
|
||||
export let event_session_id_random_li: Array<string> = [];
|
||||
export let link_to_type: string;
|
||||
export let link_to_id: string;
|
||||
export let log_lvl: number = 0;
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
|
||||
}
|
||||
|
||||
// Variables
|
||||
// let ae_promises: key_val = {};
|
||||
// let ae_tmp: key_val = {};
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
let dq__where_type_id_val: string = `${link_to_type}_id_random`;
|
||||
let dq__where_eq_id_val: string = link_to_id;
|
||||
|
||||
// Functions and Logic
|
||||
$: lq__event_session_obj_li = liveQuery(async () => {
|
||||
if (link_to_type && link_to_id) {
|
||||
let results = await db_events.sessions
|
||||
.where(dq__where_type_id_val)
|
||||
.equals(dq__where_eq_id_val)
|
||||
.sortBy('name')
|
||||
|
||||
return results;
|
||||
} else if (event_session_id_random_li.length > 0) {
|
||||
let results = await db_events.sessions
|
||||
.bulkGet(event_session_id_random_li);
|
||||
|
||||
return results;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<Comp_event_session_obj_li
|
||||
container_class_li={container_class_li}
|
||||
link_to_type={link_to_type}
|
||||
link_to_id={link_to_id}
|
||||
lq__event_session_obj_li={lq__event_session_obj_li}
|
||||
log_lvl={log_lvl}
|
||||
>
|
||||
</Comp_event_session_obj_li>
|
||||
Reference in New Issue
Block a user