Prettier for Events as a whole. Everything else under that primary directory.
This commit is contained in:
@@ -1,104 +1,120 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
container_class_li?: string | Array<string>;
|
||||
lq__event_session_obj_li?: any;
|
||||
event_session_obj_li?: any[] | null;
|
||||
hide__session_location?: boolean;
|
||||
hide__session_poc?: boolean;
|
||||
hide__admin?: boolean;
|
||||
hide__launcher_link_legacy?: boolean;
|
||||
hide__launcher_link?: boolean;
|
||||
hide__location_link?: boolean;
|
||||
show__session_files?: boolean;
|
||||
show__session_presentations?: boolean;
|
||||
}
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
container_class_li?: string | Array<string>;
|
||||
lq__event_session_obj_li?: any;
|
||||
event_session_obj_li?: any[] | null;
|
||||
hide__session_location?: boolean;
|
||||
hide__session_poc?: boolean;
|
||||
hide__admin?: boolean;
|
||||
hide__launcher_link_legacy?: boolean;
|
||||
hide__launcher_link?: boolean;
|
||||
hide__location_link?: boolean;
|
||||
show__session_files?: boolean;
|
||||
show__session_presentations?: boolean;
|
||||
}
|
||||
|
||||
let {
|
||||
log_lvl = 0,
|
||||
container_class_li = [],
|
||||
lq__event_session_obj_li = null,
|
||||
event_session_obj_li = null,
|
||||
hide__session_location = $bindable(false),
|
||||
hide__session_poc = $bindable(false),
|
||||
hide__admin = $bindable(false),
|
||||
hide__launcher_link_legacy = $bindable(false),
|
||||
hide__launcher_link = $bindable(false),
|
||||
hide__location_link = $bindable(false),
|
||||
show__session_files = $bindable(false),
|
||||
show__session_presentations = $bindable(false)
|
||||
}: Props = $props();
|
||||
let {
|
||||
log_lvl = 0,
|
||||
container_class_li = [],
|
||||
lq__event_session_obj_li = null,
|
||||
event_session_obj_li = null,
|
||||
hide__session_location = $bindable(false),
|
||||
hide__session_poc = $bindable(false),
|
||||
hide__admin = $bindable(false),
|
||||
hide__launcher_link_legacy = $bindable(false),
|
||||
hide__launcher_link = $bindable(false),
|
||||
hide__location_link = $bindable(false),
|
||||
show__session_files = $bindable(false),
|
||||
show__session_presentations = $bindable(false)
|
||||
}: Props = $props();
|
||||
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { Bell, BellOff, CalendarDays, Check, ChevronDown, ChevronUp, Clock, Edit, Eye, EyeOff, FileSearch, LoaderCircle, Mail, MapPin, Presentation, Rocket, Search, SendHorizontal, User } from '@lucide/svelte';
|
||||
import { api } from '$lib/api/api';
|
||||
import Comp_event_presenter_obj_li from './[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li_wrapper.svelte';
|
||||
import Element_manage_event_file_li from '$lib/elements/element_manage_event_file_li_direct.svelte';
|
||||
import Comp_event_session_alert from './[event_id]/(pres_mgmt)/session/ae_comp__event_session_alert.svelte';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import {
|
||||
Bell,
|
||||
BellOff,
|
||||
CalendarDays,
|
||||
Check,
|
||||
ChevronDown,
|
||||
ChevronUp,
|
||||
Clock,
|
||||
Edit,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FileSearch,
|
||||
LoaderCircle,
|
||||
Mail,
|
||||
MapPin,
|
||||
Presentation,
|
||||
Rocket,
|
||||
Search,
|
||||
SendHorizontal,
|
||||
User
|
||||
} from '@lucide/svelte';
|
||||
import { api } from '$lib/api/api';
|
||||
import Comp_event_presenter_obj_li from './[event_id]/(pres_mgmt)/presenter/ae_comp__event_presenter_obj_li_wrapper.svelte';
|
||||
import Element_manage_event_file_li from '$lib/elements/element_manage_event_file_li_direct.svelte';
|
||||
import Comp_event_session_alert from './[event_id]/(pres_mgmt)/session/ae_comp__event_session_alert.svelte';
|
||||
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
import { ae_loc, ae_api, ae_snip } from '$lib/stores/ae_stores';
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
import { ae_loc, ae_api, ae_snip } from '$lib/stores/ae_stores';
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
|
||||
let show_details_kv: Record<string, boolean> = $state({});
|
||||
let show_details_kv: Record<string, boolean> = $state({});
|
||||
|
||||
// Derived list of visible items (Standardized Pattern 2026-01-27)
|
||||
// Supports both a liveQuery observable (lq__event_session_obj_li) and a
|
||||
// plain pre-fetched array (event_session_obj_li) as a fallback.
|
||||
let visible_session_obj_li = $derived(
|
||||
(() => {
|
||||
const list = $lq__event_session_obj_li ?? event_session_obj_li;
|
||||
if (list === undefined || list === null) return null;
|
||||
if (!Array.isArray(list)) return [];
|
||||
// Derived list of visible items (Standardized Pattern 2026-01-27)
|
||||
// Supports both a liveQuery observable (lq__event_session_obj_li) and a
|
||||
// plain pre-fetched array (event_session_obj_li) as a fallback.
|
||||
let visible_session_obj_li = $derived(
|
||||
(() => {
|
||||
const list = $lq__event_session_obj_li ?? event_session_obj_li;
|
||||
if (list === undefined || list === null) return null;
|
||||
if (!Array.isArray(list)) return [];
|
||||
|
||||
const filtered = list.filter((item: any) => {
|
||||
if (!item) return false;
|
||||
if ($ae_loc.trusted_access) return true;
|
||||
return !item.hide;
|
||||
});
|
||||
const filtered = list.filter((item: any) => {
|
||||
if (!item) return false;
|
||||
if ($ae_loc.trusted_access) return true;
|
||||
return !item.hide;
|
||||
});
|
||||
|
||||
if (log_lvl)
|
||||
console.log(
|
||||
`visible_session_obj_li: Input=${list.length}, Output=${filtered.length}`
|
||||
);
|
||||
return filtered;
|
||||
})()
|
||||
);
|
||||
if (log_lvl)
|
||||
console.log(
|
||||
`visible_session_obj_li: Input=${list.length}, Output=${filtered.length}`
|
||||
);
|
||||
return filtered;
|
||||
})()
|
||||
);
|
||||
|
||||
function toggle_details(id: string) {
|
||||
show_details_kv[id] = !show_details_kv[id];
|
||||
}
|
||||
function toggle_details(id: string) {
|
||||
show_details_kv[id] = !show_details_kv[id];
|
||||
}
|
||||
</script>
|
||||
|
||||
<section
|
||||
class="ae_comp event_session_obj_li px-0.5 py-2 space-y-2 min-w-full w-full container overflow-x-auto {container_class_li}"
|
||||
>
|
||||
class="ae_comp event_session_obj_li container w-full min-w-full space-y-2 overflow-x-auto px-0.5 py-2 {container_class_li}">
|
||||
{#if visible_session_obj_li === null}
|
||||
<div class="flex flex-col items-center justify-center p-10 opacity-50">
|
||||
<LoaderCircle size="3em" class="animate-spin mb-2" />
|
||||
<LoaderCircle size="3em" class="mb-2 animate-spin" />
|
||||
|
||||
<p>Loading sessions...</p>
|
||||
</div>
|
||||
{:else if visible_session_obj_li.length > 0}
|
||||
<header
|
||||
class="w-full flex flex-row gap-2 items-center justify-start mb-2 px-2"
|
||||
>
|
||||
<h2 class="text-sm text-gray-500 font-normal">Sessions:</h2>
|
||||
class="mb-2 flex w-full flex-row items-center justify-start gap-2 px-2">
|
||||
<h2 class="text-sm font-normal text-gray-500">Sessions:</h2>
|
||||
|
||||
<span
|
||||
class="badge preset-tonal-success font-bold text-lg px-3 py-1"
|
||||
>
|
||||
class="badge preset-tonal-success px-3 py-1 text-lg font-bold">
|
||||
{visible_session_obj_li.length}<span
|
||||
class="text-gray-400 dark:text-gray-600">×</span
|
||||
>
|
||||
class="text-gray-400 dark:text-gray-600">×</span>
|
||||
</span>
|
||||
</header>
|
||||
|
||||
<table class="table table-auto table-striped w-full">
|
||||
<table class="table-striped table w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-surface-100-900">
|
||||
<th>Session</th>
|
||||
@@ -112,8 +128,7 @@
|
||||
<th
|
||||
class:hidden={!$ae_loc.edit_mode ||
|
||||
!$ae_loc.adv_mode ||
|
||||
hide__admin}>Admin</th
|
||||
>
|
||||
hide__admin}>Admin</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -122,40 +137,34 @@
|
||||
<tr
|
||||
class="relative transition-colors duration-200"
|
||||
class:opacity-50={session_obj?.hide}
|
||||
class:preset-tonal-warning={!session_obj?.enable}
|
||||
>
|
||||
class:preset-tonal-warning={!session_obj?.enable}>
|
||||
<td>
|
||||
{#if session_obj?.alert && $ae_loc.trusted_access}
|
||||
<Comp_event_session_alert
|
||||
event_session_obj={session_obj}
|
||||
{log_lvl}
|
||||
/>
|
||||
{log_lvl} />
|
||||
{/if}
|
||||
|
||||
<div class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<a
|
||||
href="/events/{session_obj?.event_id}/session/{session_obj?.event_session_id}"
|
||||
class="flex flex-row gap-2 items-center font-bold text-lg hover:text-primary-500 text-left transition-colors duration-200"
|
||||
>
|
||||
class="hover:text-primary-500 flex flex-row items-center gap-2 text-left text-lg font-bold transition-colors duration-200">
|
||||
{#if session_obj?.hide}
|
||||
<EyeOff
|
||||
size="1em"
|
||||
class="text-gray-400 flex-none"
|
||||
/>
|
||||
class="flex-none text-gray-400" />
|
||||
{:else}
|
||||
<Presentation
|
||||
size="1em"
|
||||
class="text-primary-500 flex-none"
|
||||
/>
|
||||
class="text-primary-500 flex-none" />
|
||||
{/if}
|
||||
|
||||
<span>{session_obj?.name}</span>
|
||||
|
||||
{#if session_obj?.file_count_all}
|
||||
<span
|
||||
class="badge preset-tonal-success flex items-center gap-1 text-xs py-0 px-1"
|
||||
>
|
||||
class="badge preset-tonal-success flex items-center gap-1 px-1 py-0 text-xs">
|
||||
<Check size="1em" />
|
||||
|
||||
{session_obj.file_count_all}
|
||||
@@ -170,8 +179,7 @@
|
||||
onclick={() =>
|
||||
toggle_details(
|
||||
session_obj.event_session_id
|
||||
)}
|
||||
>
|
||||
)}>
|
||||
{#if show_details_kv[session_obj.event_session_id]}
|
||||
<ChevronUp size="1.2em" />
|
||||
{:else}
|
||||
@@ -184,36 +192,31 @@
|
||||
<!-- Mobile Schedule Summary -->
|
||||
|
||||
<div
|
||||
class="md:hidden text-xs text-surface-500 flex flex-wrap gap-x-3 gap-y-1"
|
||||
>
|
||||
class="text-surface-500 flex flex-wrap gap-x-3 gap-y-1 text-xs md:hidden">
|
||||
<span class="flex items-center gap-1"
|
||||
><CalendarDays size="1em" />
|
||||
{ae_util.iso_datetime_formatter(
|
||||
session_obj?.start_datetime,
|
||||
'date_short_month_day'
|
||||
)}</span
|
||||
>
|
||||
)}</span>
|
||||
|
||||
<span class="flex items-center gap-1"
|
||||
><Clock size="1em" />
|
||||
{ae_util.iso_datetime_formatter(
|
||||
session_obj?.start_datetime,
|
||||
'time_12_short'
|
||||
)}</span
|
||||
>
|
||||
)}</span>
|
||||
</div>
|
||||
|
||||
{#if show_details_kv[session_obj.event_session_id]}
|
||||
<div
|
||||
class="p-2 bg-surface-500/5 rounded-lg border border-surface-500/10 mt-1"
|
||||
>
|
||||
class="bg-surface-500/5 border-surface-500/10 mt-1 rounded-lg border p-2">
|
||||
{#if show__session_presentations && $ae_loc.manager_access}
|
||||
<Comp_event_presenter_obj_li
|
||||
link_to_type={'event_session'}
|
||||
link_to_id={session_obj?.event_session_id}
|
||||
display_mode={'minimal'}
|
||||
{log_lvl}
|
||||
/>
|
||||
{log_lvl} />
|
||||
{/if}
|
||||
|
||||
{#if show__session_files && $ae_loc.manager_access}
|
||||
@@ -222,8 +225,7 @@
|
||||
link_to_id={session_obj?.event_session_id}
|
||||
allow_basic={true}
|
||||
allow_moderator={true}
|
||||
display_mode={'minimal'}
|
||||
/>
|
||||
display_mode={'minimal'} />
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -236,8 +238,7 @@
|
||||
>{ae_util.iso_datetime_formatter(
|
||||
session_obj?.start_datetime,
|
||||
'dddd, MMM D'
|
||||
)}</span
|
||||
>
|
||||
)}</span>
|
||||
|
||||
<span class="text-surface-500 whitespace-nowrap"
|
||||
>{ae_util.iso_datetime_formatter(
|
||||
@@ -246,17 +247,15 @@
|
||||
)} – {ae_util.iso_datetime_formatter(
|
||||
session_obj?.end_datetime,
|
||||
'time_12_short'
|
||||
)}</span
|
||||
>
|
||||
)}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class:hidden={hide__session_location}>
|
||||
<div class="flex flex-col gap-1 min-w-32">
|
||||
<div class="flex min-w-32 flex-col gap-1">
|
||||
<span class="text-xs font-semibold"
|
||||
>{session_obj?.event_location_name ??
|
||||
'--'}</span
|
||||
>
|
||||
'--'}</span>
|
||||
|
||||
<div class="flex gap-1">
|
||||
{#if !hide__launcher_link}
|
||||
@@ -264,8 +263,7 @@
|
||||
href="/events/{session_obj?.event_id}/launcher/{session_obj?.event_location_id}?session_id={session_obj?.event_session_id}"
|
||||
class="btn btn-icon btn-xs preset-tonal-tertiary"
|
||||
title="Svelte Launcher"
|
||||
><Rocket size="1em" /></a
|
||||
>
|
||||
><Rocket size="1em" /></a>
|
||||
{/if}
|
||||
|
||||
{#if !hide__location_link}
|
||||
@@ -273,28 +271,25 @@
|
||||
href="/events/{session_obj?.event_id}/location/{session_obj?.event_location_id}"
|
||||
class="btn btn-icon btn-xs preset-tonal-surface"
|
||||
title="Location Details"
|
||||
><MapPin size="1em" /></a
|
||||
>
|
||||
><MapPin size="1em" /></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class:hidden={hide__session_poc}>
|
||||
<div class="flex flex-col text-xs min-w-32">
|
||||
<div class="flex min-w-32 flex-col text-xs">
|
||||
{#if session_obj?.poc_person_full_name}
|
||||
<span
|
||||
class="font-bold flex items-center gap-1"
|
||||
class="flex items-center gap-1 font-bold"
|
||||
><User size="1em" />
|
||||
{session_obj.poc_person_full_name}</span
|
||||
>
|
||||
{session_obj.poc_person_full_name}</span>
|
||||
|
||||
{#if $ae_loc.trusted_access && session_obj?.poc_person_primary_email}
|
||||
<a
|
||||
href="mailto:{session_obj.poc_person_primary_email}"
|
||||
class="text-primary-500 hover:underline flex items-center gap-1"
|
||||
><Mail size="1em" /> Email</a
|
||||
>
|
||||
class="text-primary-500 flex items-center gap-1 hover:underline"
|
||||
><Mail size="1em" /> Email</a>
|
||||
{/if}
|
||||
{:else}
|
||||
<span class="opacity-30">--</span>
|
||||
@@ -305,8 +300,7 @@
|
||||
<td
|
||||
class:hidden={!$ae_loc.edit_mode ||
|
||||
!$ae_loc.adv_mode ||
|
||||
hide__admin}
|
||||
>
|
||||
hide__admin}>
|
||||
<div class="flex gap-1">
|
||||
<button
|
||||
type="button"
|
||||
@@ -321,15 +315,17 @@
|
||||
fields: { hide: !session_obj.hide },
|
||||
log_lvl: 1
|
||||
});
|
||||
events_func.load_ae_obj_id__event_session({
|
||||
api_cfg: $ae_api,
|
||||
event_session_id: session_obj.event_session_id
|
||||
});
|
||||
}}
|
||||
>
|
||||
events_func.load_ae_obj_id__event_session(
|
||||
{
|
||||
api_cfg: $ae_api,
|
||||
event_session_id:
|
||||
session_obj.event_session_id
|
||||
}
|
||||
);
|
||||
}}>
|
||||
{#if session_obj?.hide}<EyeOff
|
||||
size="1.2em"
|
||||
/>{:else}<Eye size="1.2em" />{/if}
|
||||
size="1.2em" />{:else}<Eye
|
||||
size="1.2em" />{/if}
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -342,18 +338,22 @@
|
||||
api_cfg: $ae_api,
|
||||
obj_type: 'event_session',
|
||||
obj_id: session_obj.event_session_id,
|
||||
fields: { alert: !session_obj.alert },
|
||||
fields: {
|
||||
alert: !session_obj.alert
|
||||
},
|
||||
log_lvl: 1
|
||||
});
|
||||
events_func.load_ae_obj_id__event_session({
|
||||
api_cfg: $ae_api,
|
||||
event_session_id: session_obj.event_session_id
|
||||
});
|
||||
}}
|
||||
>
|
||||
events_func.load_ae_obj_id__event_session(
|
||||
{
|
||||
api_cfg: $ae_api,
|
||||
event_session_id:
|
||||
session_obj.event_session_id
|
||||
}
|
||||
);
|
||||
}}>
|
||||
{#if session_obj?.alert}<Bell
|
||||
size="1.2em"
|
||||
/>{:else}<BellOff size="1.2em" />{/if}
|
||||
size="1.2em" />{:else}<BellOff
|
||||
size="1.2em" />{/if}
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
@@ -363,9 +363,8 @@
|
||||
</table>
|
||||
{:else}
|
||||
<div
|
||||
class="flex flex-col items-center justify-center p-20 opacity-50 text-center bg-surface-50 dark:bg-surface-900/50 rounded-lg border border-dashed border-surface-300"
|
||||
>
|
||||
<FileSearch size="3em" class="mb-2 opacity-20 mx-auto" />
|
||||
class="bg-surface-50 dark:bg-surface-900/50 border-surface-300 flex flex-col items-center justify-center rounded-lg border border-dashed p-20 text-center opacity-50">
|
||||
<FileSearch size="3em" class="mx-auto mb-2 opacity-20" />
|
||||
|
||||
<p class="text-xl">No sessions found matching your criteria.</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user