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:
@@ -16,7 +16,9 @@ export async function load({ fetch, params, parent }) {
|
||||
let ae_acct = data[account_id];
|
||||
|
||||
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 = {
|
||||
api: data.ae_api || {},
|
||||
slct: {
|
||||
|
||||
@@ -31,7 +31,12 @@
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
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 Comp__archive_obj_li from './ae_idaa_comp__archive_obj_li.svelte';
|
||||
@@ -109,7 +114,8 @@
|
||||
allow_access: $ae_loc?.allow_access,
|
||||
last_cache_refresh: $ae_loc?.last_cache_refresh,
|
||||
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,
|
||||
iframe: $ae_loc?.iframe
|
||||
// site_access_key: $ae_loc?.site_access_key,
|
||||
@@ -152,15 +158,20 @@
|
||||
|
||||
{#await lq__archive_obj_li}
|
||||
<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="text-lg text-gray-600 dark:text-gray-400">Loading archives...</span>
|
||||
<span class="fas fa-spinner fa-spin text-4xl text-primary-500 mb-4"
|
||||
></span>
|
||||
<span class="text-lg text-gray-600 dark:text-gray-400"
|
||||
>Loading archives...</span
|
||||
>
|
||||
</div>
|
||||
{:then}
|
||||
{#if $lq__archive_obj_li && $lq__archive_obj_li?.length}
|
||||
<Comp__archive_obj_li {lq__archive_obj_li} />
|
||||
{:else}
|
||||
<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">
|
||||
Archives will appear here once created.
|
||||
</p>
|
||||
|
||||
@@ -65,16 +65,26 @@
|
||||
let lq__archive_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
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
|
||||
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 };
|
||||
if (log_lvl) {
|
||||
console.log(`$idaa_slct.archive_obj = `, $idaa_slct.archive_obj);
|
||||
console.log(
|
||||
`$idaa_slct.archive_obj = `,
|
||||
$idaa_slct.archive_obj
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (log_lvl) {
|
||||
@@ -101,20 +111,29 @@
|
||||
// Dexie will automatically track these table accesses and re-run this query if they change.
|
||||
const [parent_archive, results] = await Promise.all([
|
||||
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 (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 [];
|
||||
}
|
||||
|
||||
// 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';
|
||||
|
||||
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)
|
||||
@@ -124,17 +143,21 @@
|
||||
|
||||
if (is_desc) {
|
||||
// MODE: Newest First (DESC) - Typically used for years or chronological groupings
|
||||
|
||||
|
||||
// 1. Group (DESC) - e.g. Year "2024" should appear before "2023"
|
||||
if (groupA !== groupB) return groupB.localeCompare(groupA);
|
||||
|
||||
// 2. Original Datetime (DESC) - Newer items within the same group first
|
||||
const dateA = a.original_datetime ? new Date(a.original_datetime).getTime() : 0;
|
||||
const dateB = b.original_datetime ? new Date(b.original_datetime).getTime() : 0;
|
||||
const dateA = a.original_datetime
|
||||
? 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;
|
||||
} else {
|
||||
// MODE: Standard (ASC) - Typically used for Parts, Chapters, or alphabetical groupings
|
||||
|
||||
|
||||
// 1. Group (ASC) - e.g. "Part 1" before "Part 2"
|
||||
if (groupA !== groupB) return groupA.localeCompare(groupB);
|
||||
}
|
||||
@@ -151,8 +174,12 @@
|
||||
|
||||
// 5. Fallback: Original Datetime ASC (if in Standard mode and manual sorts are equal)
|
||||
if (!is_desc) {
|
||||
const dateA = a.original_datetime ? new Date(a.original_datetime).getTime() : 0;
|
||||
const dateB = b.original_datetime ? new Date(b.original_datetime).getTime() : 0;
|
||||
const dateA = a.original_datetime
|
||||
? 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;
|
||||
}
|
||||
|
||||
@@ -172,11 +199,16 @@
|
||||
);
|
||||
}
|
||||
// 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
|
||||
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 };
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
@@ -231,8 +263,8 @@
|
||||
// .delete();
|
||||
// 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,
|
||||
for_obj_type: 'archive',
|
||||
for_obj_id: $idaa_slct.archive_id,
|
||||
@@ -242,8 +274,7 @@
|
||||
order_by_li: $idaa_loc.archives.qry__order_by_li,
|
||||
try_cache: true,
|
||||
log_lvl: log_lvl
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -254,7 +285,9 @@
|
||||
window.parent.postMessage(message, '*');
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -262,7 +295,9 @@
|
||||
onDestroy(() => {
|
||||
log_lvl = 1;
|
||||
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 };
|
||||
@@ -338,10 +373,13 @@
|
||||
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}
|
||||
<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 $ae_loc.trusted_access && $lq__archive_obj?.hide}
|
||||
@@ -412,7 +450,8 @@
|
||||
<h3 class="text-lg font-semibold">
|
||||
{#if $ae_loc.trusted_access}
|
||||
<!-- <div class="ae_options"> -->
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_id', $lq__archive_obj?.event_id_random);
|
||||
@@ -439,7 +478,8 @@
|
||||
<Archive_obj_id_edit {lq__archive_obj} />
|
||||
|
||||
{#snippet footer()}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary"
|
||||
onclick={() => {
|
||||
$idaa_sess.archives.show__modal_view__archive_id = false;
|
||||
@@ -467,7 +507,8 @@
|
||||
<h3 class="text-lg font-semibold">
|
||||
{#if $ae_loc.trusted_access}
|
||||
<!-- <div class="ae_options"> -->
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
// const url = new URL(location);
|
||||
// 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} />
|
||||
|
||||
{#snippet footer()}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary"
|
||||
onclick={() => {
|
||||
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||
|
||||
@@ -60,7 +60,9 @@
|
||||
file_icons['zip'] = 'file-archive';
|
||||
</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}
|
||||
<!-- <div class="ae_group">
|
||||
<span class="ae_label">Group:</span>
|
||||
@@ -77,14 +79,17 @@
|
||||
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"
|
||||
onclick={() => {
|
||||
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_sess.archives.show_list__archive_content_li_group = null;
|
||||
$idaa_sess.archives.show_list__archive_content_li_group =
|
||||
null;
|
||||
} else {
|
||||
$idaa_sess.archives.show_list__archive_content_li_group =
|
||||
idaa_archive_content_obj.group;
|
||||
@@ -115,12 +120,16 @@
|
||||
class:hidden={(idaa_archive_content_obj.hide ||
|
||||
!idaa_archive_content_obj?.enable) &&
|
||||
!$ae_loc.edit_mode}
|
||||
class:dim={idaa_archive_content_obj.hide && $ae_loc.edit_mode}
|
||||
class:dim_warning={!idaa_archive_content_obj?.enable && $ae_loc.edit_mode}
|
||||
class:dim={idaa_archive_content_obj.hide &&
|
||||
$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">
|
||||
<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>
|
||||
|
||||
{#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"
|
||||
>
|
||||
{#if idaa_archive_content_obj?.hosted_file_id}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.authenticated_access}
|
||||
onclick={() => {
|
||||
$idaa_slct.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);
|
||||
url.searchParams.set(
|
||||
@@ -157,7 +168,8 @@
|
||||
// replaceState(url, {});
|
||||
|
||||
let message = {
|
||||
archive_content_id: $idaa_slct?.archive_content_id
|
||||
archive_content_id:
|
||||
$idaa_slct?.archive_content_id
|
||||
};
|
||||
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"
|
||||
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'}
|
||||
Play
|
||||
{:else}
|
||||
@@ -201,20 +215,29 @@
|
||||
/>
|
||||
{/if}
|
||||
{:else}
|
||||
<span class="text-sm text-gray-500 italic" title="No file linked.">
|
||||
<span class="fas fa-exclamation-triangle text-warning"></span>
|
||||
<span
|
||||
class="text-sm text-gray-500 italic"
|
||||
title="No file linked."
|
||||
>
|
||||
<span
|
||||
class="fas fa-exclamation-triangle text-warning"
|
||||
></span>
|
||||
No file linked.
|
||||
<span class="fas fa-exclamation-triangle text-warning"></span>
|
||||
<span
|
||||
class="fas fa-exclamation-triangle text-warning"
|
||||
></span>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.trusted_access && $ae_loc.edit_mode}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access}
|
||||
onclick={() => {
|
||||
$idaa_slct.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_edit__archive_content_id =
|
||||
@@ -230,22 +253,34 @@
|
||||
|
||||
<section class="ae_section archive_content__content">
|
||||
{#if idaa_archive_content_obj?.description}
|
||||
<div class="archive_content__description ae_description">
|
||||
<div class="ae_label archive_content__description text-sm">
|
||||
<div
|
||||
class="archive_content__description ae_description"
|
||||
>
|
||||
<div
|
||||
class="ae_label archive_content__description text-sm"
|
||||
>
|
||||
Description:
|
||||
</div>
|
||||
<div class="ae_value archive_content__description">
|
||||
<div
|
||||
class="ae_value archive_content__description"
|
||||
>
|
||||
{@html idaa_archive_content_obj?.description}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if idaa_archive_content_obj?.content_html}
|
||||
<div class="archive_content__content_html ae_content_html">
|
||||
<div class="ae_label archive_content__content_html text-sm">
|
||||
<div
|
||||
class="archive_content__content_html ae_content_html"
|
||||
>
|
||||
<div
|
||||
class="ae_label archive_content__content_html text-sm"
|
||||
>
|
||||
Content:
|
||||
</div>
|
||||
<div class="ae_value archive_content__content_html">
|
||||
<div
|
||||
class="ae_value archive_content__content_html"
|
||||
>
|
||||
{@html idaa_archive_content_obj?.content_html}
|
||||
</div>
|
||||
</div>
|
||||
@@ -256,9 +291,12 @@
|
||||
class:hidden={!idaa_archive_content_obj?.original_datetime &&
|
||||
!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}
|
||||
<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(
|
||||
idaa_archive_content_obj.original_datetime,
|
||||
'datetime_12_long'
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
let prom_api__archive_obj: 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 notes_new_html = $state($idaa_slct.archive_obj?.notes ?? '');
|
||||
let notes_changed = $state(false);
|
||||
@@ -205,7 +207,8 @@
|
||||
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;
|
||||
|
||||
return update_archive_obj_promise;
|
||||
@@ -280,7 +283,10 @@
|
||||
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||
})
|
||||
.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(() => {
|
||||
// $idaa_sess.recovery_meetings.show__modal_edit = false;
|
||||
@@ -306,10 +312,14 @@
|
||||
>
|
||||
<form onsubmit={prevent_default(handle_submit_form)} class="space-y-1">
|
||||
{#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}
|
||||
{#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}
|
||||
<!-- <div class="awaiting" out:fade={{ duration: 2000 }}>Nothing here yet</div> -->
|
||||
{/if}
|
||||
@@ -317,7 +327,9 @@
|
||||
|
||||
<!-- <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>
|
||||
<label for="name" class="w-full">
|
||||
<span class="text-sm font-semibold"> Name of Archive </span>
|
||||
@@ -351,7 +363,9 @@
|
||||
</label>
|
||||
</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>
|
||||
|
||||
<label for="original_datetime"
|
||||
@@ -521,18 +535,25 @@
|
||||
id="cfg_json"
|
||||
class="textarea w-full font-mono text-sm"
|
||||
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 $ae_loc.trusted_access}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="
|
||||
novi_btn
|
||||
btn btn-sm float-right
|
||||
"
|
||||
class:preset-filled-success-200-800={$idaa_loc.archives.show__admin_options}
|
||||
class:preset-filled-tertiary-200-800={!$idaa_loc.archives.show__admin_options}
|
||||
class:preset-filled-success-200-800={$idaa_loc.archives
|
||||
.show__admin_options}
|
||||
class:preset-filled-tertiary-200-800={!$idaa_loc.archives
|
||||
.show__admin_options}
|
||||
onclick={() => {
|
||||
$idaa_loc.archives.show__admin_options =
|
||||
!$idaa_loc.archives.show__admin_options;
|
||||
@@ -562,11 +583,14 @@
|
||||
<span
|
||||
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
|
||||
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
|
||||
>
|
||||
<div>
|
||||
@@ -596,7 +620,8 @@
|
||||
<fieldset
|
||||
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
|
||||
>
|
||||
<div>
|
||||
@@ -658,7 +683,8 @@
|
||||
<fieldset
|
||||
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
|
||||
>
|
||||
<div>
|
||||
@@ -667,7 +693,9 @@
|
||||
id="enable_yes"
|
||||
name="enable"
|
||||
value={true}
|
||||
bind:group={$idaa_slct.archive_obj.enable}
|
||||
bind:group={
|
||||
$idaa_slct.archive_obj.enable
|
||||
}
|
||||
class="radio form-check-input"
|
||||
/>
|
||||
<label for="enable_yes">Yes</label>
|
||||
@@ -678,7 +706,9 @@
|
||||
id="enable_no"
|
||||
name="enable"
|
||||
value={false}
|
||||
bind:group={$idaa_slct.archive_obj.enable}
|
||||
bind:group={
|
||||
$idaa_slct.archive_obj.enable
|
||||
}
|
||||
class="radio form-check-input"
|
||||
/>
|
||||
<label for="enable_no">No</label>
|
||||
@@ -686,13 +716,18 @@
|
||||
</fieldset>
|
||||
</span>
|
||||
{:else}
|
||||
<input type="hidden" name="enable" value={$idaa_slct.archive_obj.enable} />
|
||||
<input
|
||||
type="hidden"
|
||||
name="enable"
|
||||
value={$idaa_slct.archive_obj.enable}
|
||||
/>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<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
|
||||
>
|
||||
<AE_Comp_Editor_TipTap
|
||||
@@ -715,7 +750,9 @@
|
||||
<!-- END: section archive__admin_options -->
|
||||
{/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
|
||||
type="submit"
|
||||
class="
|
||||
@@ -729,12 +766,19 @@
|
||||
</button>
|
||||
|
||||
{#if $idaa_slct.archive_id}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
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;
|
||||
}
|
||||
handle_delete_archive_obj({ archive_id: $idaa_slct.archive_id });
|
||||
handle_delete_archive_obj({
|
||||
archive_id: $idaa_slct.archive_id
|
||||
});
|
||||
}}
|
||||
class="
|
||||
novi_btn
|
||||
|
||||
@@ -27,7 +27,11 @@
|
||||
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_tmp: key_val = {};
|
||||
@@ -56,7 +60,9 @@
|
||||
</header> -->
|
||||
|
||||
<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}
|
||||
</div>{/if}
|
||||
{#if $lq__archive_obj?.content_html}<div class="ae_value">
|
||||
@@ -65,7 +71,9 @@
|
||||
{#if $lq__archive_obj?.original_url}
|
||||
<div>
|
||||
<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>
|
||||
{/if}
|
||||
{#if $lq__archive_obj?.original_datetime}
|
||||
@@ -81,12 +89,16 @@
|
||||
{/if}
|
||||
{#if $lq__archive_obj?.original_timezone}
|
||||
<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 $lq__archive_obj?.original_location}
|
||||
<div>
|
||||
<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>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -126,7 +138,8 @@
|
||||
>
|
||||
<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')}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
$idaa_loc.archives.qry__enabled = 'enabled';
|
||||
$idaa_loc.archives.qry__hidden = 'all';
|
||||
@@ -139,7 +152,8 @@
|
||||
<span class="fas fa-eye m-1"></span> Show Hidden Content
|
||||
</button>
|
||||
{:else if $ae_loc.trusted_access && $idaa_loc.archives.qry__hidden != 'not_hidden'}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
$idaa_loc.archives.qry__enabled = 'enabled';
|
||||
$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"
|
||||
>
|
||||
<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>
|
||||
{/if}
|
||||
|
||||
{#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={() => {
|
||||
$idaa_loc.archives.qry__enabled = 'all';
|
||||
$idaa_loc.archives.qry__hidden = 'all';
|
||||
@@ -167,7 +183,8 @@
|
||||
<span class="fas fa-eye m-1"></span> Show Disabled Events
|
||||
</button>
|
||||
{:else if $ae_loc.administrator_access && $idaa_loc.archives.qry__enabled != 'enabled'}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
$idaa_loc.archives.qry__enabled = 'enabled';
|
||||
$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"
|
||||
>
|
||||
<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>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
<div class="ae_options">
|
||||
<!-- {#if $ae_loc.trusted_access} -->
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access}
|
||||
onclick={() => {
|
||||
if (!confirm('Add new archive content?')) {
|
||||
@@ -202,7 +221,8 @@
|
||||
<span class="fas fa-plus m-1"></span> Add Content
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access}
|
||||
onclick={() => {
|
||||
// $idaa_slct.archive_id = $lq__archive_obj?.archive_id_random;
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary absolute top-2 right-2"
|
||||
onclick={() => {
|
||||
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||
@@ -74,7 +75,8 @@
|
||||
<Media_player {lq__archive_content_obj} />
|
||||
|
||||
{#snippet footer()}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-secondary"
|
||||
onclick={() => {
|
||||
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||
|
||||
@@ -37,23 +37,31 @@
|
||||
{#each $lq__archive_obj_li as idaa_archive_obj, index}
|
||||
<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:hidden={(idaa_archive_obj?.hide || !idaa_archive_obj?.enable) &&
|
||||
class:hidden={(idaa_archive_obj?.hide ||
|
||||
!idaa_archive_obj?.enable) &&
|
||||
!$ae_loc.trusted_access}
|
||||
class:dim={idaa_archive_obj.hide}
|
||||
class:bg-warning-100={!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">
|
||||
<span class="fas fa-archive m-1 text-neutral-800/80"></span>
|
||||
<span class="archive__name">{@html idaa_archive_obj.name}</span>
|
||||
<span class="fas fa-archive m-1 text-neutral-800/80"
|
||||
></span>
|
||||
<span class="archive__name"
|
||||
>{@html idaa_archive_obj.name}</span
|
||||
>
|
||||
</h3>
|
||||
|
||||
{#if idaa_archive_obj.original_location}
|
||||
<!-- — -->
|
||||
<h4 class="h4">
|
||||
<!-- <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>
|
||||
{/if}
|
||||
</header>
|
||||
@@ -61,7 +69,9 @@
|
||||
{#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}
|
||||
|
||||
<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
|
||||
href="/idaa/archives/{idaa_archive_obj?.archive_id}"
|
||||
class="
|
||||
@@ -72,11 +82,14 @@
|
||||
title={`View: ${idaa_archive_obj?.name}`}
|
||||
>
|
||||
<!-- <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
|
||||
|
||||
{#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>
|
||||
{idaa_archive_obj?.archive_content_count == 1
|
||||
? `${idaa_archive_obj?.archive_content_count} content`
|
||||
@@ -88,7 +101,8 @@
|
||||
|
||||
<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:hidden={!$ae_loc.administrator_access && !$ae_loc.edit_mode}
|
||||
class:hidden={!$ae_loc.administrator_access &&
|
||||
!$ae_loc.edit_mode}
|
||||
>
|
||||
<div class="ae_group">
|
||||
{#if !idaa_archive_obj.updated_on}
|
||||
|
||||
@@ -53,7 +53,9 @@
|
||||
|
||||
$effect(() => {
|
||||
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();
|
||||
|
||||
@@ -82,16 +84,24 @@
|
||||
|
||||
<section class="ae_content flex flex-col gap-2 items-center justify-center">
|
||||
{#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>
|
||||
No Hosted File Linked
|
||||
<span class="fas fa-exclamation-triangle text-warning"></span>
|
||||
</span>
|
||||
{: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
|
||||
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}"
|
||||
type="audio/mpeg"
|
||||
/>
|
||||
@@ -103,7 +113,8 @@
|
||||
<!-- style="max-width: 100%; max-height: 65vh;" -->
|
||||
<video autoplay controls class="w-full h-auto">
|
||||
<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}"
|
||||
type="video/mp4"
|
||||
/>
|
||||
@@ -113,14 +124,16 @@
|
||||
</video>
|
||||
{:else if file_icons[$idaa_slct.archive_content_obj.file_extension] == 'file-image'}
|
||||
<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}"
|
||||
alt={$idaa_slct.archive_content_obj.name}
|
||||
style="max-width: 100%; max-height: 65vh;"
|
||||
/>
|
||||
{:else}
|
||||
<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}"
|
||||
target="_blank"
|
||||
class="
|
||||
|
||||
Reference in New Issue
Block a user