refactor(archives): apply batch formatting to the module

- Finalized batch formatting (printWidth: 80) across all components in the archives module.
This commit is contained in:
Scott Idem
2026-02-06 16:19:07 -05:00
parent d21e2f8e6f
commit 2e8e4c7a7b
9 changed files with 298 additions and 112 deletions

View File

@@ -16,7 +16,9 @@ export async function load({ fetch, params, parent }) {
let ae_acct = data[account_id]; let ae_acct = data[account_id];
if (!ae_acct) { if (!ae_acct) {
console.warn(`ae IDAA Archives +layout.ts: Account ${account_id} not found in data. Initializing ghost acct.`); console.warn(
`ae IDAA Archives +layout.ts: Account ${account_id} not found in data. Initializing ghost acct.`
);
ae_acct = { ae_acct = {
api: data.ae_api || {}, api: data.ae_api || {},
slct: { slct: {

View File

@@ -31,7 +31,12 @@
slct_trigger slct_trigger
} from '$lib/stores/ae_stores'; } from '$lib/stores/ae_stores';
import { core_func } from '$lib/ae_core/ae_core_functions'; import { core_func } from '$lib/ae_core/ae_core_functions';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig } from '$lib/stores/ae_idaa_stores'; import {
idaa_loc,
idaa_sess,
idaa_slct,
idaa_trig
} from '$lib/stores/ae_idaa_stores';
// import { archives_func } from '$lib/ae_archives/ae_archives_functions'; // import { archives_func } from '$lib/ae_archives/ae_archives_functions';
import Comp__archive_obj_li from './ae_idaa_comp__archive_obj_li.svelte'; import Comp__archive_obj_li from './ae_idaa_comp__archive_obj_li.svelte';
@@ -109,7 +114,8 @@
allow_access: $ae_loc?.allow_access, allow_access: $ae_loc?.allow_access,
last_cache_refresh: $ae_loc?.last_cache_refresh, last_cache_refresh: $ae_loc?.last_cache_refresh,
last_cache_refresh_iso: last_cache_refresh_iso.toISOString(), last_cache_refresh_iso: last_cache_refresh_iso.toISOString(),
last_cache_refresh_locale: last_cache_refresh_iso.toLocaleString(), last_cache_refresh_locale:
last_cache_refresh_iso.toLocaleString(),
access_level: $ae_loc?.access_level, access_level: $ae_loc?.access_level,
iframe: $ae_loc?.iframe iframe: $ae_loc?.iframe
// site_access_key: $ae_loc?.site_access_key, // site_access_key: $ae_loc?.site_access_key,
@@ -152,15 +158,20 @@
{#await lq__archive_obj_li} {#await lq__archive_obj_li}
<div class="flex flex-col items-top justify-center p-8"> <div class="flex flex-col items-top justify-center p-8">
<span class="fas fa-spinner fa-spin text-4xl text-primary-500 mb-4"></span> <span class="fas fa-spinner fa-spin text-4xl text-primary-500 mb-4"
<span class="text-lg text-gray-600 dark:text-gray-400">Loading archives...</span> ></span>
<span class="text-lg text-gray-600 dark:text-gray-400"
>Loading archives...</span
>
</div> </div>
{:then} {:then}
{#if $lq__archive_obj_li && $lq__archive_obj_li?.length} {#if $lq__archive_obj_li && $lq__archive_obj_li?.length}
<Comp__archive_obj_li {lq__archive_obj_li} /> <Comp__archive_obj_li {lq__archive_obj_li} />
{:else} {:else}
<div class="flex flex-col items-top justify-center p-4 text-center"> <div class="flex flex-col items-top justify-center p-4 text-center">
<p class="text-lg text-gray-600 dark:text-gray-400 mb-4">No archives found.</p> <p class="text-lg text-gray-600 dark:text-gray-400 mb-4">
No archives found.
</p>
<p class="text-md text-gray-500 dark:text-gray-300"> <p class="text-md text-gray-500 dark:text-gray-300">
Archives will appear here once created. Archives will appear here once created.
</p> </p>

View File

@@ -65,16 +65,26 @@
let lq__archive_obj = $derived( let lq__archive_obj = $derived(
liveQuery(async () => { liveQuery(async () => {
if (log_lvl) { if (log_lvl) {
console.log(`lq__archive_obj: archive_id = ${$idaa_slct?.archive_id}`); console.log(
`lq__archive_obj: archive_id = ${$idaa_slct?.archive_id}`
);
} }
let results = await db_archives.archive.get($idaa_slct?.archive_id ?? ''); // null or undefined does not reset things like '' does let results = await db_archives.archive.get(
$idaa_slct?.archive_id ?? ''
); // null or undefined does not reset things like '' does
// Check if results are different than the current $idaa_slct.archive_obj // Check if results are different than the current $idaa_slct.archive_obj
if ($idaa_slct.archive_obj && results) { if ($idaa_slct.archive_obj && results) {
if (JSON.stringify($idaa_slct.archive_obj) !== JSON.stringify(results)) { if (
JSON.stringify($idaa_slct.archive_obj) !==
JSON.stringify(results)
) {
$idaa_slct.archive_obj = { ...results }; $idaa_slct.archive_obj = { ...results };
if (log_lvl) { if (log_lvl) {
console.log(`$idaa_slct.archive_obj = `, $idaa_slct.archive_obj); console.log(
`$idaa_slct.archive_obj = `,
$idaa_slct.archive_obj
);
} }
} else { } else {
if (log_lvl) { if (log_lvl) {
@@ -101,20 +111,29 @@
// Dexie will automatically track these table accesses and re-run this query if they change. // Dexie will automatically track these table accesses and re-run this query if they change.
const [parent_archive, results] = await Promise.all([ const [parent_archive, results] = await Promise.all([
db_archives.archive.get(archive_id), db_archives.archive.get(archive_id),
db_archives.content.where('archive_id').equals(archive_id).toArray() db_archives.content
.where('archive_id')
.equals(archive_id)
.toArray()
]); ]);
if (!results || results.length === 0) { if (!results || results.length === 0) {
if (log_lvl) console.log('lq__archive_content_obj_li: No content records found in cache.'); if (log_lvl)
console.log(
'lq__archive_content_obj_li: No content records found in cache.'
);
return []; return [];
} }
// Determine sort mode from the parent archive configuration // Determine sort mode from the parent archive configuration
const sort_mode = parent_archive?.cfg_json?.content_group_sort ?? 'ASC'; const sort_mode =
parent_archive?.cfg_json?.content_group_sort ?? 'ASC';
const is_desc = sort_mode === 'DESC'; const is_desc = sort_mode === 'DESC';
if (log_lvl) { if (log_lvl) {
console.log(`lq__archive_content_obj_li: Sorting ${results.length} items using ${sort_mode} mode.`); console.log(
`lq__archive_content_obj_li: Sorting ${results.length} items using ${sort_mode} mode.`
);
} }
// Apply multi-step in-memory sort to handle mixed directions (e.g. Group DESC + Sort ASC) // Apply multi-step in-memory sort to handle mixed directions (e.g. Group DESC + Sort ASC)
@@ -129,8 +148,12 @@
if (groupA !== groupB) return groupB.localeCompare(groupA); if (groupA !== groupB) return groupB.localeCompare(groupA);
// 2. Original Datetime (DESC) - Newer items within the same group first // 2. Original Datetime (DESC) - Newer items within the same group first
const dateA = a.original_datetime ? new Date(a.original_datetime).getTime() : 0; const dateA = a.original_datetime
const dateB = b.original_datetime ? new Date(b.original_datetime).getTime() : 0; ? new Date(a.original_datetime).getTime()
: 0;
const dateB = b.original_datetime
? new Date(b.original_datetime).getTime()
: 0;
if (dateA !== dateB) return dateB - dateA; if (dateA !== dateB) return dateB - dateA;
} else { } else {
// MODE: Standard (ASC) - Typically used for Parts, Chapters, or alphabetical groupings // MODE: Standard (ASC) - Typically used for Parts, Chapters, or alphabetical groupings
@@ -151,8 +174,12 @@
// 5. Fallback: Original Datetime ASC (if in Standard mode and manual sorts are equal) // 5. Fallback: Original Datetime ASC (if in Standard mode and manual sorts are equal)
if (!is_desc) { if (!is_desc) {
const dateA = a.original_datetime ? new Date(a.original_datetime).getTime() : 0; const dateA = a.original_datetime
const dateB = b.original_datetime ? new Date(b.original_datetime).getTime() : 0; ? new Date(a.original_datetime).getTime()
: 0;
const dateB = b.original_datetime
? new Date(b.original_datetime).getTime()
: 0;
if (dateA !== dateB) return dateA - dateB; if (dateA !== dateB) return dateA - dateB;
} }
@@ -172,11 +199,16 @@
); );
} }
// if ($idaa_slct.archive_content_id) { // if ($idaa_slct.archive_content_id) {
let results = await db_archives.content.get($idaa_slct.archive_content_id ?? ''); // null or undefined does not reset things like '' does let results = await db_archives.content.get(
$idaa_slct.archive_content_id ?? ''
); // null or undefined does not reset things like '' does
// Check if results are different than the current $idaa_slct.archive_content_obj // Check if results are different than the current $idaa_slct.archive_content_obj
if ($idaa_slct.archive_content_obj && results) { if ($idaa_slct.archive_content_obj && results) {
if (JSON.stringify($idaa_slct.archive_content_obj) !== JSON.stringify(results)) { if (
JSON.stringify($idaa_slct.archive_content_obj) !==
JSON.stringify(results)
) {
$idaa_slct.archive_content_obj = { ...results }; $idaa_slct.archive_content_obj = { ...results };
if (log_lvl) { if (log_lvl) {
console.log( console.log(
@@ -231,8 +263,8 @@
// .delete(); // .delete();
// console.log(`Deleted ${results} disabled archive content.`); // console.log(`Deleted ${results} disabled archive content.`);
$idaa_prom.load__archive_content_obj_li = archives_func.load_ae_obj_li__archive_content( $idaa_prom.load__archive_content_obj_li =
{ archives_func.load_ae_obj_li__archive_content({
api_cfg: $ae_api, api_cfg: $ae_api,
for_obj_type: 'archive', for_obj_type: 'archive',
for_obj_id: $idaa_slct.archive_id, for_obj_id: $idaa_slct.archive_id,
@@ -242,8 +274,7 @@
order_by_li: $idaa_loc.archives.qry__order_by_li, order_by_li: $idaa_loc.archives.qry__order_by_li,
try_cache: true, try_cache: true,
log_lvl: log_lvl log_lvl: log_lvl
} });
);
} }
}); });
@@ -254,7 +285,9 @@
window.parent.postMessage(message, '*'); window.parent.postMessage(message, '*');
if ($ae_loc?.iframe) { if ($ae_loc?.iframe) {
console.log('In iframe, sending message to parent window to scroll to top as well'); console.log(
'In iframe, sending message to parent window to scroll to top as well'
);
window.parent.postMessage({ scroll_to: 0 }, '*'); // This should be in pixels window.parent.postMessage({ scroll_to: 0 }, '*'); // This should be in pixels
} }
} }
@@ -262,7 +295,9 @@
onDestroy(() => { onDestroy(() => {
log_lvl = 1; log_lvl = 1;
if (log_lvl) { if (log_lvl) {
console.log(`Destroying archives page for archive_id: ${$idaa_slct?.archive_id}`); console.log(
`Destroying archives page for archive_id: ${$idaa_slct?.archive_id}`
);
} }
let message = { archive_id: null }; let message = { archive_id: null };
@@ -338,10 +373,13 @@
max-w-full max-w-full
" "
> >
<span class="float-right flex flex-row flex-wrap gap-1 items-center justify-end"> <span
class="float-right flex flex-row flex-wrap gap-1 items-center justify-end"
>
{#if $lq__archive_obj?.topic_name} {#if $lq__archive_obj?.topic_name}
<span class="badge badge-info preset-tonal-tertiary" <span class="badge badge-info preset-tonal-tertiary"
><span class="fas fa-user-md m-1"></span> {$lq__archive_obj?.topic_name}</span ><span class="fas fa-user-md m-1"></span>
{$lq__archive_obj?.topic_name}</span
> >
{/if} {/if}
{#if $ae_loc.trusted_access && $lq__archive_obj?.hide} {#if $ae_loc.trusted_access && $lq__archive_obj?.hide}
@@ -412,7 +450,8 @@
<h3 class="text-lg font-semibold"> <h3 class="text-lg font-semibold">
{#if $ae_loc.trusted_access} {#if $ae_loc.trusted_access}
<!-- <div class="ae_options"> --> <!-- <div class="ae_options"> -->
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
// const url = new URL(location); // const url = new URL(location);
// url.searchParams.set('event_id', $lq__archive_obj?.event_id_random); // url.searchParams.set('event_id', $lq__archive_obj?.event_id_random);
@@ -439,7 +478,8 @@
<Archive_obj_id_edit {lq__archive_obj} /> <Archive_obj_id_edit {lq__archive_obj} />
{#snippet footer()} {#snippet footer()}
<button type="button" <button
type="button"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
onclick={() => { onclick={() => {
$idaa_sess.archives.show__modal_view__archive_id = false; $idaa_sess.archives.show__modal_view__archive_id = false;
@@ -467,7 +507,8 @@
<h3 class="text-lg font-semibold"> <h3 class="text-lg font-semibold">
{#if $ae_loc.trusted_access} {#if $ae_loc.trusted_access}
<!-- <div class="ae_options"> --> <!-- <div class="ae_options"> -->
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
// const url = new URL(location); // const url = new URL(location);
// url.searchParams.set('event_id', $lq__archive_content_obj?.event_id_random); // url.searchParams.set('event_id', $lq__archive_content_obj?.event_id_random);
@@ -496,7 +537,8 @@
<Archive_content_obj_id_edit {lq__archive_content_obj} /> <Archive_content_obj_id_edit {lq__archive_content_obj} />
{#snippet footer()} {#snippet footer()}
<button type="button" <button
type="button"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
onclick={() => { onclick={() => {
$idaa_sess.archives.show__modal_view__archive_content_id = false; $idaa_sess.archives.show__modal_view__archive_content_id = false;

View File

@@ -60,7 +60,9 @@
file_icons['zip'] = 'file-archive'; file_icons['zip'] = 'file-archive';
</script> </script>
<section class="archive_list flex flex-col gap-2 items-center justify-center w-full"> <section
class="archive_list flex flex-col gap-2 items-center justify-center w-full"
>
{#if $lq__archive_content_obj_li && $lq__archive_content_obj_li.length} {#if $lq__archive_content_obj_li && $lq__archive_content_obj_li.length}
<!-- <div class="ae_group"> <!-- <div class="ae_group">
<span class="ae_label">Group:</span> <span class="ae_label">Group:</span>
@@ -77,14 +79,17 @@
w-full max-w-(--breakpoint-lg) w-full max-w-(--breakpoint-lg)
" "
> >
<button type="button" <button
type="button"
class="novi_btn novi_margin_sm btn btn-md btn-info preset-tonal-secondary hover:preset-filled-secondary-500 transition w-96" class="novi_btn novi_margin_sm btn btn-md btn-info preset-tonal-secondary hover:preset-filled-secondary-500 transition w-96"
onclick={() => { onclick={() => {
if ( if (
$idaa_sess.archives.show_list__archive_content_li_group == $idaa_sess.archives
.show_list__archive_content_li_group ==
idaa_archive_content_obj.group idaa_archive_content_obj.group
) { ) {
$idaa_sess.archives.show_list__archive_content_li_group = null; $idaa_sess.archives.show_list__archive_content_li_group =
null;
} else { } else {
$idaa_sess.archives.show_list__archive_content_li_group = $idaa_sess.archives.show_list__archive_content_li_group =
idaa_archive_content_obj.group; idaa_archive_content_obj.group;
@@ -115,12 +120,16 @@
class:hidden={(idaa_archive_content_obj.hide || class:hidden={(idaa_archive_content_obj.hide ||
!idaa_archive_content_obj?.enable) && !idaa_archive_content_obj?.enable) &&
!$ae_loc.edit_mode} !$ae_loc.edit_mode}
class:dim={idaa_archive_content_obj.hide && $ae_loc.edit_mode} class:dim={idaa_archive_content_obj.hide &&
class:dim_warning={!idaa_archive_content_obj?.enable && $ae_loc.edit_mode} $ae_loc.edit_mode}
class:dim_warning={!idaa_archive_content_obj?.enable &&
$ae_loc.edit_mode}
> >
<header class="ae_header flex flex-row gap-2 items-center"> <header class="ae_header flex flex-row gap-2 items-center">
<h3 class="archive__name h4"> <h3 class="archive__name h4">
<span class="archive__name">{@html idaa_archive_content_obj.name}</span> <span class="archive__name"
>{@html idaa_archive_content_obj.name}</span
>
</h3> </h3>
{#if idaa_archive_content_obj.original_location} {#if idaa_archive_content_obj.original_location}
@@ -141,12 +150,14 @@
class="ae_options flex flex-row flex-wrap gap-2 items-center justify-center" class="ae_options flex flex-row flex-wrap gap-2 items-center justify-center"
> >
{#if idaa_archive_content_obj?.hosted_file_id} {#if idaa_archive_content_obj?.hosted_file_id}
<button type="button" <button
type="button"
disabled={!$ae_loc.authenticated_access} disabled={!$ae_loc.authenticated_access}
onclick={() => { onclick={() => {
$idaa_slct.archive_content_id = $idaa_slct.archive_content_id =
idaa_archive_content_obj?.archive_content_id; idaa_archive_content_obj?.archive_content_id;
$idaa_slct.archive_content_obj = idaa_archive_content_obj; $idaa_slct.archive_content_obj =
idaa_archive_content_obj;
const url = new URL(location.href); const url = new URL(location.href);
url.searchParams.set( url.searchParams.set(
@@ -157,7 +168,8 @@
// replaceState(url, {}); // replaceState(url, {});
let message = { let message = {
archive_content_id: $idaa_slct?.archive_content_id archive_content_id:
$idaa_slct?.archive_content_id
}; };
window.parent.postMessage(message, '*'); window.parent.postMessage(message, '*');
@@ -177,7 +189,9 @@
class="novi_btn btn btn-md btn-secondary preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 transition" class="novi_btn btn btn-md btn-secondary preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 transition"
title={`Play/View: ${idaa_archive_content_obj?.name}`} title={`Play/View: ${idaa_archive_content_obj?.name}`}
> >
<span class="fas fa-play m-1 text-neutral-800/80"></span> <span
class="fas fa-play m-1 text-neutral-800/80"
></span>
{#if file_icons[idaa_archive_content_obj.file_extension] == 'file-audio' || file_icons[idaa_archive_content_obj.file_extension] == 'file-video'} {#if file_icons[idaa_archive_content_obj.file_extension] == 'file-audio' || file_icons[idaa_archive_content_obj.file_extension] == 'file-video'}
Play Play
{:else} {:else}
@@ -201,20 +215,29 @@
/> />
{/if} {/if}
{:else} {:else}
<span class="text-sm text-gray-500 italic" title="No file linked."> <span
<span class="fas fa-exclamation-triangle text-warning"></span> class="text-sm text-gray-500 italic"
title="No file linked."
>
<span
class="fas fa-exclamation-triangle text-warning"
></span>
No file linked. No file linked.
<span class="fas fa-exclamation-triangle text-warning"></span> <span
class="fas fa-exclamation-triangle text-warning"
></span>
</span> </span>
{/if} {/if}
{#if $ae_loc.trusted_access && $ae_loc.edit_mode} {#if $ae_loc.trusted_access && $ae_loc.edit_mode}
<button type="button" <button
type="button"
disabled={!$ae_loc.trusted_access} disabled={!$ae_loc.trusted_access}
onclick={() => { onclick={() => {
$idaa_slct.archive_content_id = $idaa_slct.archive_content_id =
idaa_archive_content_obj.archive_content_id; idaa_archive_content_obj.archive_content_id;
$idaa_slct.archive_content_obj = idaa_archive_content_obj; $idaa_slct.archive_content_obj =
idaa_archive_content_obj;
$idaa_sess.archives.show__modal_view__archive_content_id = false; $idaa_sess.archives.show__modal_view__archive_content_id = false;
$idaa_sess.archives.show__modal_edit__archive_content_id = $idaa_sess.archives.show__modal_edit__archive_content_id =
@@ -230,22 +253,34 @@
<section class="ae_section archive_content__content"> <section class="ae_section archive_content__content">
{#if idaa_archive_content_obj?.description} {#if idaa_archive_content_obj?.description}
<div class="archive_content__description ae_description"> <div
<div class="ae_label archive_content__description text-sm"> class="archive_content__description ae_description"
>
<div
class="ae_label archive_content__description text-sm"
>
Description: Description:
</div> </div>
<div class="ae_value archive_content__description"> <div
class="ae_value archive_content__description"
>
{@html idaa_archive_content_obj?.description} {@html idaa_archive_content_obj?.description}
</div> </div>
</div> </div>
{/if} {/if}
{#if idaa_archive_content_obj?.content_html} {#if idaa_archive_content_obj?.content_html}
<div class="archive_content__content_html ae_content_html"> <div
<div class="ae_label archive_content__content_html text-sm"> class="archive_content__content_html ae_content_html"
>
<div
class="ae_label archive_content__content_html text-sm"
>
Content: Content:
</div> </div>
<div class="ae_value archive_content__content_html"> <div
class="ae_value archive_content__content_html"
>
{@html idaa_archive_content_obj?.content_html} {@html idaa_archive_content_obj?.content_html}
</div> </div>
</div> </div>
@@ -256,9 +291,12 @@
class:hidden={!idaa_archive_content_obj?.original_datetime && class:hidden={!idaa_archive_content_obj?.original_datetime &&
!idaa_archive_content_obj?.original_timezone} !idaa_archive_content_obj?.original_timezone}
> >
<span class="ae_label text-sm">Original date/time:</span> <span class="ae_label text-sm"
>Original date/time:</span
>
{#if idaa_archive_content_obj.original_datetime} {#if idaa_archive_content_obj.original_datetime}
<span class="ae_value ae_prop prop_original_datetime font-semibold" <span
class="ae_value ae_prop prop_original_datetime font-semibold"
>{ae_util.iso_datetime_formatter( >{ae_util.iso_datetime_formatter(
idaa_archive_content_obj.original_datetime, idaa_archive_content_obj.original_datetime,
'datetime_12_long' 'datetime_12_long'

View File

@@ -35,7 +35,9 @@
let prom_api__archive_obj: any; let prom_api__archive_obj: any;
let prom_api__archive_obj__hosted_file: any; let prom_api__archive_obj__hosted_file: any;
let description_new_html = $state($idaa_slct.archive_obj?.description ?? ''); let description_new_html = $state(
$idaa_slct.archive_obj?.description ?? ''
);
let description_changed = $state(false); let description_changed = $state(false);
let notes_new_html = $state($idaa_slct.archive_obj?.notes ?? ''); let notes_new_html = $state($idaa_slct.archive_obj?.notes ?? '');
let notes_changed = $state(false); let notes_changed = $state(false);
@@ -205,7 +207,8 @@
return false; return false;
} }
$idaa_slct.archive_id = archive_obj_create_result.archive_id_random; $idaa_slct.archive_id =
archive_obj_create_result.archive_id_random;
$idaa_slct.archive_obj = archive_obj_create_result; $idaa_slct.archive_obj = archive_obj_create_result;
return update_archive_obj_promise; return update_archive_obj_promise;
@@ -280,7 +283,10 @@
$idaa_sess.archives.show__modal_view__archive_content_id = false; $idaa_sess.archives.show__modal_view__archive_content_id = false;
}) })
.catch(function (error: any) { .catch(function (error: any) {
console.log('The result was null or false when trying to delete.', error); console.log(
'The result was null or false when trying to delete.',
error
);
}) })
.finally(() => { .finally(() => {
// $idaa_sess.recovery_meetings.show__modal_edit = false; // $idaa_sess.recovery_meetings.show__modal_edit = false;
@@ -306,10 +312,14 @@
> >
<form onsubmit={prevent_default(handle_submit_form)} class="space-y-1"> <form onsubmit={prevent_default(handle_submit_form)} class="space-y-1">
{#await update_archive_obj_promise} {#await update_archive_obj_promise}
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div> <div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>
Saving...
</div>
{:then} {:then}
{#if update_archive_obj_promise} {#if update_archive_obj_promise}
<div class="awaiting" out:fade={{ duration: 2000 }}>Finished saving</div> <div class="awaiting" out:fade={{ duration: 2000 }}>
Finished saving
</div>
{:else} {:else}
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> --> <!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
{/if} {/if}
@@ -317,7 +327,9 @@
<!-- <h2 class="h2">Archive</h2> --> <!-- <h2 class="h2">Archive</h2> -->
<div class="ae_section archive__general border border-gray-200 rounded p-2 space-y-2"> <div
class="ae_section archive__general border border-gray-200 rounded p-2 space-y-2"
>
<div> <div>
<label for="name" class="w-full"> <label for="name" class="w-full">
<span class="text-sm font-semibold"> Name of Archive </span> <span class="text-sm font-semibold"> Name of Archive </span>
@@ -351,7 +363,9 @@
</label> </label>
</div> </div>
<div class="ae_section archive__original border border-gray-200 rounded p-2 space-y-2"> <div
class="ae_section archive__original border border-gray-200 rounded p-2 space-y-2"
>
<h3 class="h3">Original</h3> <h3 class="h3">Original</h3>
<label for="original_datetime" <label for="original_datetime"
@@ -521,18 +535,25 @@
id="cfg_json" id="cfg_json"
class="textarea w-full font-mono text-sm" class="textarea w-full font-mono text-sm"
rows={$idaa_slct.archive_obj.cfg_json?.length ?? 6} rows={$idaa_slct.archive_obj.cfg_json?.length ?? 6}
>{JSON.stringify($idaa_slct.archive_obj.cfg_json, null, 2)}</textarea >{JSON.stringify(
$idaa_slct.archive_obj.cfg_json,
null,
2
)}</textarea
> >
{/if} {/if}
{#if $ae_loc.trusted_access} {#if $ae_loc.trusted_access}
<button type="button" <button
type="button"
class=" class="
novi_btn novi_btn
btn btn-sm float-right btn btn-sm float-right
" "
class:preset-filled-success-200-800={$idaa_loc.archives.show__admin_options} class:preset-filled-success-200-800={$idaa_loc.archives
class:preset-filled-tertiary-200-800={!$idaa_loc.archives.show__admin_options} .show__admin_options}
class:preset-filled-tertiary-200-800={!$idaa_loc.archives
.show__admin_options}
onclick={() => { onclick={() => {
$idaa_loc.archives.show__admin_options = $idaa_loc.archives.show__admin_options =
!$idaa_loc.archives.show__admin_options; !$idaa_loc.archives.show__admin_options;
@@ -562,11 +583,14 @@
<span <span
class="flex flex-col md:flex-row flex-wrap gap-2 items-center justify-center md:justify-stretch w-full" class="flex flex-col md:flex-row flex-wrap gap-2 items-center justify-center md:justify-stretch w-full"
> >
<span class="flex flex-row flex-wrap gap-1 items-center justify-evenly grow"> <span
class="flex flex-row flex-wrap gap-1 items-center justify-evenly grow"
>
<fieldset <fieldset
class="flex flex-row gap-1 items-center justify-center form-check" class="flex flex-row gap-1 items-center justify-center form-check"
> >
<legend class="legend text-sm font-semibold form-check-label" <legend
class="legend text-sm font-semibold form-check-label"
>Hide</legend >Hide</legend
> >
<div> <div>
@@ -596,7 +620,8 @@
<fieldset <fieldset
class="flex flex-row gap-1 items-center justify-center form-check" class="flex flex-row gap-1 items-center justify-center form-check"
> >
<legend class="legend text-sm font-semibold form-check-label" <legend
class="legend text-sm font-semibold form-check-label"
>Priority</legend >Priority</legend
> >
<div> <div>
@@ -658,7 +683,8 @@
<fieldset <fieldset
class="flex flex-row gap-1 items-center align-center form-check" class="flex flex-row gap-1 items-center align-center form-check"
> >
<legend class="legend text-sm font-semibold form-check-label" <legend
class="legend text-sm font-semibold form-check-label"
>Enable</legend >Enable</legend
> >
<div> <div>
@@ -667,7 +693,9 @@
id="enable_yes" id="enable_yes"
name="enable" name="enable"
value={true} value={true}
bind:group={$idaa_slct.archive_obj.enable} bind:group={
$idaa_slct.archive_obj.enable
}
class="radio form-check-input" class="radio form-check-input"
/> />
<label for="enable_yes">Yes</label> <label for="enable_yes">Yes</label>
@@ -678,7 +706,9 @@
id="enable_no" id="enable_no"
name="enable" name="enable"
value={false} value={false}
bind:group={$idaa_slct.archive_obj.enable} bind:group={
$idaa_slct.archive_obj.enable
}
class="radio form-check-input" class="radio form-check-input"
/> />
<label for="enable_no">No</label> <label for="enable_no">No</label>
@@ -686,13 +716,18 @@
</fieldset> </fieldset>
</span> </span>
{:else} {:else}
<input type="hidden" name="enable" value={$idaa_slct.archive_obj.enable} /> <input
type="hidden"
name="enable"
value={$idaa_slct.archive_obj.enable}
/>
{/if} {/if}
</span> </span>
{#if $ae_loc.trusted_access} {#if $ae_loc.trusted_access}
<label for="notes" class="w-full"> <label for="notes" class="w-full">
<span class="legend text-sm font-semibold text-surface-600-400" <span
class="legend text-sm font-semibold text-surface-600-400"
>Internal Staff Notes</span >Internal Staff Notes</span
> >
<AE_Comp_Editor_TipTap <AE_Comp_Editor_TipTap
@@ -715,7 +750,9 @@
<!-- END: section archive__admin_options --> <!-- END: section archive__admin_options -->
{/if} {/if}
<div class="ae_section ae_options flex flex-row gap-1 items-center justify-center"> <div
class="ae_section ae_options flex flex-row gap-1 items-center justify-center"
>
<button <button
type="submit" type="submit"
class=" class="
@@ -729,12 +766,19 @@
</button> </button>
{#if $idaa_slct.archive_id} {#if $idaa_slct.archive_id}
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
if (!confirm('Are you sure you want to delete this archive?')) { if (
!confirm(
'Are you sure you want to delete this archive?'
)
) {
return false; return false;
} }
handle_delete_archive_obj({ archive_id: $idaa_slct.archive_id }); handle_delete_archive_obj({
archive_id: $idaa_slct.archive_id
});
}} }}
class=" class="
novi_btn novi_btn

View File

@@ -27,7 +27,11 @@
lq__archive_content_obj_li: any; lq__archive_content_obj_li: any;
} }
let { log_lvl = 0, lq__archive_obj, lq__archive_content_obj_li }: Props = $props(); let {
log_lvl = 0,
lq__archive_obj,
lq__archive_content_obj_li
}: Props = $props();
// let ae_promises: key_val = {}; // let ae_promises: key_val = {};
// let ae_tmp: key_val = {}; // let ae_tmp: key_val = {};
@@ -56,7 +60,9 @@
</header> --> </header> -->
<div class="archive__content w-2xl"> <div class="archive__content w-2xl">
{#if $lq__archive_obj?.description}<div class="ae_value archive__description"> {#if $lq__archive_obj?.description}<div
class="ae_value archive__description"
>
{@html $lq__archive_obj?.description} {@html $lq__archive_obj?.description}
</div>{/if} </div>{/if}
{#if $lq__archive_obj?.content_html}<div class="ae_value"> {#if $lq__archive_obj?.content_html}<div class="ae_value">
@@ -65,7 +71,9 @@
{#if $lq__archive_obj?.original_url} {#if $lq__archive_obj?.original_url}
<div> <div>
<span class="ae_label text-sm">URL:</span> <span class="ae_label text-sm">URL:</span>
<span class="ae_value font-semibold">{$lq__archive_obj?.original_url}</span> <span class="ae_value font-semibold"
>{$lq__archive_obj?.original_url}</span
>
</div> </div>
{/if} {/if}
{#if $lq__archive_obj?.original_datetime} {#if $lq__archive_obj?.original_datetime}
@@ -81,12 +89,16 @@
{/if} {/if}
{#if $lq__archive_obj?.original_timezone} {#if $lq__archive_obj?.original_timezone}
<span class="ae_label text-sm">Timezone:</span> <span class="ae_label text-sm">Timezone:</span>
<span class="ae_value font-semibold">{$lq__archive_obj?.original_timezone}</span> <span class="ae_value font-semibold"
>{$lq__archive_obj?.original_timezone}</span
>
{/if} {/if}
{#if $lq__archive_obj?.original_location} {#if $lq__archive_obj?.original_location}
<div> <div>
<span class="ae_label text-sm">Location:</span> <span class="ae_label text-sm">Location:</span>
<span class="ae_value font-semibold">{$lq__archive_obj?.original_location}</span> <span class="ae_value font-semibold"
>{$lq__archive_obj?.original_location}</span
>
</div> </div>
{/if} {/if}
</div> </div>
@@ -126,7 +138,8 @@
> >
<span class="flex flex-row gap-1 items-center justify-around"> <span class="flex flex-row gap-1 items-center justify-around">
{#if $ae_loc.edit_mode && $ae_loc.trusted_access && (!$idaa_loc.archives.qry__hidden || $idaa_loc.archives.qry__hidden == 'not_hidden')} {#if $ae_loc.edit_mode && $ae_loc.trusted_access && (!$idaa_loc.archives.qry__hidden || $idaa_loc.archives.qry__hidden == 'not_hidden')}
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
$idaa_loc.archives.qry__enabled = 'enabled'; $idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'all'; $idaa_loc.archives.qry__hidden = 'all';
@@ -139,7 +152,8 @@
<span class="fas fa-eye m-1"></span> Show Hidden Content <span class="fas fa-eye m-1"></span> Show Hidden Content
</button> </button>
{:else if $ae_loc.trusted_access && $idaa_loc.archives.qry__hidden != 'not_hidden'} {:else if $ae_loc.trusted_access && $idaa_loc.archives.qry__hidden != 'not_hidden'}
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
$idaa_loc.archives.qry__enabled = 'enabled'; $idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'not_hidden'; $idaa_loc.archives.qry__hidden = 'not_hidden';
@@ -149,12 +163,14 @@
}} }}
class="novi_btn btn_hide_archives_archive_content ae_btn btn btn-info btn-sm preset-tonal-secondary border border-secondary-500" class="novi_btn btn_hide_archives_archive_content ae_btn btn btn-info btn-sm preset-tonal-secondary border border-secondary-500"
> >
<span class="fas fa-eye-slash m-1"></span> Hide Hidden Content <span class="fas fa-eye-slash m-1"></span> Hide Hidden
Content
</button> </button>
{/if} {/if}
{#if $ae_loc.edit_mode && $ae_loc.administrator_access && (!$idaa_loc.archives.qry__enabled || $idaa_loc.archives.qry__enabled == 'enabled')} {#if $ae_loc.edit_mode && $ae_loc.administrator_access && (!$idaa_loc.archives.qry__enabled || $idaa_loc.archives.qry__enabled == 'enabled')}
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
$idaa_loc.archives.qry__enabled = 'all'; $idaa_loc.archives.qry__enabled = 'all';
$idaa_loc.archives.qry__hidden = 'all'; $idaa_loc.archives.qry__hidden = 'all';
@@ -167,7 +183,8 @@
<span class="fas fa-eye m-1"></span> Show Disabled Events <span class="fas fa-eye m-1"></span> Show Disabled Events
</button> </button>
{:else if $ae_loc.administrator_access && $idaa_loc.archives.qry__enabled != 'enabled'} {:else if $ae_loc.administrator_access && $idaa_loc.archives.qry__enabled != 'enabled'}
<button type="button" <button
type="button"
onclick={() => { onclick={() => {
$idaa_loc.archives.qry__enabled = 'enabled'; $idaa_loc.archives.qry__enabled = 'enabled';
$idaa_loc.archives.qry__hidden = 'all'; $idaa_loc.archives.qry__hidden = 'all';
@@ -177,14 +194,16 @@
}} }}
class="novi_btn btn_hide_bb_post ae_btn btn btn-warning btn-sm preset-tonal-secondary border border-secondary-500" class="novi_btn btn_hide_bb_post ae_btn btn btn-warning btn-sm preset-tonal-secondary border border-secondary-500"
> >
<span class="fas fa-eye-slash m-1"></span> Hide Disabled Events <span class="fas fa-eye-slash m-1"></span> Hide Disabled
Events
</button> </button>
{/if} {/if}
</span> </span>
<div class="ae_options"> <div class="ae_options">
<!-- {#if $ae_loc.trusted_access} --> <!-- {#if $ae_loc.trusted_access} -->
<button type="button" <button
type="button"
disabled={!$ae_loc.trusted_access} disabled={!$ae_loc.trusted_access}
onclick={() => { onclick={() => {
if (!confirm('Add new archive content?')) { if (!confirm('Add new archive content?')) {
@@ -202,7 +221,8 @@
<span class="fas fa-plus m-1"></span> Add Content <span class="fas fa-plus m-1"></span> Add Content
</button> </button>
<button type="button" <button
type="button"
disabled={!$ae_loc.trusted_access} disabled={!$ae_loc.trusted_access}
onclick={() => { onclick={() => {
// $idaa_slct.archive_id = $lq__archive_obj?.archive_id_random; // $idaa_slct.archive_id = $lq__archive_obj?.archive_id_random;

View File

@@ -56,7 +56,8 @@
</h3> </h3>
</div> </div>
<button type="button" <button
type="button"
class="btn btn-sm btn-secondary absolute top-2 right-2" class="btn btn-sm btn-secondary absolute top-2 right-2"
onclick={() => { onclick={() => {
$idaa_sess.archives.show__modal_view__archive_content_id = false; $idaa_sess.archives.show__modal_view__archive_content_id = false;
@@ -74,7 +75,8 @@
<Media_player {lq__archive_content_obj} /> <Media_player {lq__archive_content_obj} />
{#snippet footer()} {#snippet footer()}
<button type="button" <button
type="button"
class="btn btn-sm btn-secondary" class="btn btn-sm btn-secondary"
onclick={() => { onclick={() => {
$idaa_sess.archives.show__modal_view__archive_content_id = false; $idaa_sess.archives.show__modal_view__archive_content_id = false;

View File

@@ -37,23 +37,31 @@
{#each $lq__archive_obj_li as idaa_archive_obj, index} {#each $lq__archive_obj_li as idaa_archive_obj, index}
<div <div
class="container archive archive_obj border rounded p-2 mb-2 space-y-2 w-full max-w-(--breakpoint-lg) flex flex-col items-center justify-center" class="container archive archive_obj border rounded p-2 mb-2 space-y-2 w-full max-w-(--breakpoint-lg) flex flex-col items-center justify-center"
class:hidden={(idaa_archive_obj?.hide || !idaa_archive_obj?.enable) && class:hidden={(idaa_archive_obj?.hide ||
!idaa_archive_obj?.enable) &&
!$ae_loc.trusted_access} !$ae_loc.trusted_access}
class:dim={idaa_archive_obj.hide} class:dim={idaa_archive_obj.hide}
class:bg-warning-100={!idaa_archive_obj?.enable} class:bg-warning-100={!idaa_archive_obj?.enable}
class:text-warning-900={!idaa_archive_obj?.enable} class:text-warning-900={!idaa_archive_obj?.enable}
> >
<header class="ae_header flex flex-row gap-2 items-center justify-between w-full"> <header
class="ae_header flex flex-row gap-2 items-center justify-between w-full"
>
<h3 class="archive__name h3"> <h3 class="archive__name h3">
<span class="fas fa-archive m-1 text-neutral-800/80"></span> <span class="fas fa-archive m-1 text-neutral-800/80"
<span class="archive__name">{@html idaa_archive_obj.name}</span> ></span>
<span class="archive__name"
>{@html idaa_archive_obj.name}</span
>
</h3> </h3>
{#if idaa_archive_obj.original_location} {#if idaa_archive_obj.original_location}
<!-- &mdash; --> <!-- &mdash; -->
<h4 class="h4"> <h4 class="h4">
<!-- <span class="ae_label">Location:</span> --> <!-- <span class="ae_label">Location:</span> -->
<span class="ae_value">{idaa_archive_obj.original_location}</span> <span class="ae_value"
>{idaa_archive_obj.original_location}</span
>
</h4> </h4>
{/if} {/if}
</header> </header>
@@ -61,7 +69,9 @@
{#if idaa_archive_obj.description}<pre {#if idaa_archive_obj.description}<pre
class="archive__description p-2 bg-white shadow-md rounded-lg text-sm font-normal text-wrap whitespace-pre-wrap word-break max-w-(--breakpoint-md) novi_text_wrap">{@html idaa_archive_obj.description}</pre>{/if} class="archive__description p-2 bg-white shadow-md rounded-lg text-sm font-normal text-wrap whitespace-pre-wrap word-break max-w-(--breakpoint-md) novi_text_wrap">{@html idaa_archive_obj.description}</pre>{/if}
<div class="ae_options flex flex-row gap-2 items-center justify-center"> <div
class="ae_options flex flex-row gap-2 items-center justify-center"
>
<a <a
href="/idaa/archives/{idaa_archive_obj?.archive_id}" href="/idaa/archives/{idaa_archive_obj?.archive_id}"
class=" class="
@@ -72,11 +82,14 @@
title={`View: ${idaa_archive_obj?.name}`} title={`View: ${idaa_archive_obj?.name}`}
> >
<!-- <span class="fas fa-envelope-open m-1"></span> --> <!-- <span class="fas fa-envelope-open m-1"></span> -->
<span class="fas fa-box-open m-1 text-neutral-800/80"></span> <span class="fas fa-box-open m-1 text-neutral-800/80"
></span>
Open Open
{#if idaa_archive_obj?.archive_content_count} {#if idaa_archive_obj?.archive_content_count}
<span class="ae_badge ae_info archive__archive_content_count"> <span
class="ae_badge ae_info archive__archive_content_count"
>
<span class="fas fa-content"></span> <span class="fas fa-content"></span>
{idaa_archive_obj?.archive_content_count == 1 {idaa_archive_obj?.archive_content_count == 1
? `${idaa_archive_obj?.archive_content_count} content` ? `${idaa_archive_obj?.archive_content_count} content`
@@ -88,7 +101,8 @@
<section <section
class="ae_section ae_footer ae_meta archive__meta mt-2 flex flex-col sm:flex-row gap-1 items-center justify-center text-sm text-gray-500" class="ae_section ae_footer ae_meta archive__meta mt-2 flex flex-col sm:flex-row gap-1 items-center justify-center text-sm text-gray-500"
class:hidden={!$ae_loc.administrator_access && !$ae_loc.edit_mode} class:hidden={!$ae_loc.administrator_access &&
!$ae_loc.edit_mode}
> >
<div class="ae_group"> <div class="ae_group">
{#if !idaa_archive_obj.updated_on} {#if !idaa_archive_obj.updated_on}

View File

@@ -53,7 +53,9 @@
$effect(() => { $effect(() => {
if (browser && $lq__archive_content_obj?.archive_content_id) { if (browser && $lq__archive_content_obj?.archive_content_id) {
console.log('** Component Mounted: ** Media Player - Archive Content Obj'); console.log(
'** Component Mounted: ** Media Player - Archive Content Obj'
);
document.body.scrollIntoView(); document.body.scrollIntoView();
@@ -82,16 +84,24 @@
<section class="ae_content flex flex-col gap-2 items-center justify-center"> <section class="ae_content flex flex-col gap-2 items-center justify-center">
{#if !$idaa_slct.archive_content_obj.hosted_file_id} {#if !$idaa_slct.archive_content_obj.hosted_file_id}
<span class="text-center text-lg text-gray-500 bg-yellow-100 p-2 rounded-lg"> <span
class="text-center text-lg text-gray-500 bg-yellow-100 p-2 rounded-lg"
>
<span class="fas fa-exclamation-triangle text-warning"></span> <span class="fas fa-exclamation-triangle text-warning"></span>
No Hosted File Linked No Hosted File Linked
<span class="fas fa-exclamation-triangle text-warning"></span> <span class="fas fa-exclamation-triangle text-warning"></span>
</span> </span>
{:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'} {:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-audio'}
<audio autoplay controls style="max-width: 100%; max-height: 65vh;" class="w-96 h-auto"> <audio
autoplay
controls
style="max-width: 100%; max-height: 65vh;"
class="w-96 h-auto"
>
<source <source
id="view_archive_content_audio_source" id="view_archive_content_audio_source"
src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct.archive_content_obj src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct
.archive_content_obj
?.hosted_file_id}/download?key={$ae_api.account_id}" ?.hosted_file_id}/download?key={$ae_api.account_id}"
type="audio/mpeg" type="audio/mpeg"
/> />
@@ -103,7 +113,8 @@
<!-- style="max-width: 100%; max-height: 65vh;" --> <!-- style="max-width: 100%; max-height: 65vh;" -->
<video autoplay controls class="w-full h-auto"> <video autoplay controls class="w-full h-auto">
<source <source
src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct.archive_content_obj src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct
.archive_content_obj
?.hosted_file_id}/download?key={$ae_api.account_id}" ?.hosted_file_id}/download?key={$ae_api.account_id}"
type="video/mp4" type="video/mp4"
/> />
@@ -113,14 +124,16 @@
</video> </video>
{:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-image'} {:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-image'}
<img <img
src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct.archive_content_obj src="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct
.archive_content_obj
?.hosted_file_id}/download?key={$ae_api.account_id}" ?.hosted_file_id}/download?key={$ae_api.account_id}"
alt={$idaa_slct.archive_content_obj.name} alt={$idaa_slct.archive_content_obj.name}
style="max-width: 100%; max-height: 65vh;" style="max-width: 100%; max-height: 65vh;"
/> />
{:else} {:else}
<a <a
href="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct.archive_content_obj href="{$ae_api.base_url}/v3/action/hosted_file/{$idaa_slct
.archive_content_obj
?.hosted_file_id}/download?key={$ae_api.account_id}" ?.hosted_file_id}/download?key={$ae_api.account_id}"
target="_blank" target="_blank"
class=" class="