Last round of prettier: npx prettier --write src/
This commit is contained in:
@@ -1,127 +1,149 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
// import { liveQuery } from "dexie";
|
||||
import MyClipboard from '$lib/app_components/e_app_clipboard.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
// import { liveQuery } from "dexie";
|
||||
import MyClipboard from '$lib/app_components/e_app_clipboard.svelte';
|
||||
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { api } from '$lib/api/api';
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
import { api } from '$lib/api/api';
|
||||
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
import {
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct,
|
||||
events_trigger
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
import AE_Comp_Hosted_Files_Download_Button from '$lib/ae_core/ae_comp__hosted_files_download_button.svelte';
|
||||
import { Check, Clock, Download, Eye, EyeOff, FileImage, FolderOpen, Laptop, LoaderCircle, Monitor, Pencil, RefreshCw, Save, Trash2, TriangleAlert } from '@lucide/svelte';
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
container_class_li?: string | Array<string>;
|
||||
lq__event_file_obj_li: any;
|
||||
link_to_type: string;
|
||||
link_to_id: string;
|
||||
allow_basic?: boolean;
|
||||
allow_moderator?: boolean;
|
||||
display_mode?: string; // 'default', 'compact', 'minimal', 'launcher'
|
||||
// WHY: event_file.event_session_type_code is NULL for presenter-linked files because
|
||||
// v_event_file joins event_session only via event_file.event_session_id, which is NULL
|
||||
// when for_type='event_presenter'. The wrapper derives the correct type from the
|
||||
// presenter → presentation → session chain and passes it here as context.
|
||||
context_session_type_code?: string | null;
|
||||
// import { core_func } from '$lib/ae_core_functions';
|
||||
import {
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
import { db_events } from '$lib/ae_events/db_events';
|
||||
import {
|
||||
events_loc,
|
||||
events_sess,
|
||||
events_slct,
|
||||
events_trigger
|
||||
} from '$lib/stores/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events/ae_events_functions';
|
||||
import AE_Comp_Hosted_Files_Download_Button from '$lib/ae_core/ae_comp__hosted_files_download_button.svelte';
|
||||
import {
|
||||
Check,
|
||||
Clock,
|
||||
Download,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FileImage,
|
||||
FolderOpen,
|
||||
Laptop,
|
||||
LoaderCircle,
|
||||
Monitor,
|
||||
Pencil,
|
||||
RefreshCw,
|
||||
Save,
|
||||
Trash2,
|
||||
TriangleAlert
|
||||
} from '@lucide/svelte';
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
container_class_li?: string | Array<string>;
|
||||
lq__event_file_obj_li: any;
|
||||
link_to_type: string;
|
||||
link_to_id: string;
|
||||
allow_basic?: boolean;
|
||||
allow_moderator?: boolean;
|
||||
display_mode?: string; // 'default', 'compact', 'minimal', 'launcher'
|
||||
// WHY: event_file.event_session_type_code is NULL for presenter-linked files because
|
||||
// v_event_file joins event_session only via event_file.event_session_id, which is NULL
|
||||
// when for_type='event_presenter'. The wrapper derives the correct type from the
|
||||
// presenter → presentation → session chain and passes it here as context.
|
||||
context_session_type_code?: string | null;
|
||||
}
|
||||
|
||||
let {
|
||||
log_lvl = 0,
|
||||
container_class_li = [],
|
||||
lq__event_file_obj_li,
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
allow_basic = false,
|
||||
allow_moderator = false,
|
||||
display_mode = 'default',
|
||||
context_session_type_code = null
|
||||
}: Props = $props();
|
||||
|
||||
// export let show_convert_btn: null|boolean = null;
|
||||
|
||||
// let ae_placeholder_li: key_val = {};
|
||||
let ae_promises: key_val = $state({});
|
||||
let ae_tmp: key_val = $state({});
|
||||
ae_tmp.show__file_li = true;
|
||||
ae_tmp.show__direct_download = $events_loc.pres_mgmt.show__direct_download;
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
onMount(() => {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`Element - Manage Event File List: link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`
|
||||
);
|
||||
console.log(
|
||||
`allow_basic: ${allow_basic}; allow_moderator: ${allow_moderator}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
let {
|
||||
log_lvl = 0,
|
||||
container_class_li = [],
|
||||
lq__event_file_obj_li,
|
||||
link_to_type,
|
||||
link_to_id,
|
||||
allow_basic = false,
|
||||
allow_moderator = false,
|
||||
display_mode = 'default',
|
||||
context_session_type_code = null
|
||||
}: Props = $props();
|
||||
let clipboard_success = $state(false);
|
||||
|
||||
// export let show_convert_btn: null|boolean = null;
|
||||
// PDF → Image conversion state (keyed by event_file_id)
|
||||
// WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there.
|
||||
// Presenters upload PDFs which must be converted server-side to high-res webp images.
|
||||
// Button is only shown in edit_mode for PDF files linked to a poster-type session.
|
||||
// Backend: /v3/action/hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only)
|
||||
// and saves the result as a new hosted_file record linked to the same parent object.
|
||||
type ConvertStatus = 'idle' | 'converting' | 'done' | 'error';
|
||||
let convert_status_kv: Record<string, ConvertStatus> = $state({});
|
||||
let convert_result_kv: key_val = $state({});
|
||||
|
||||
// let ae_placeholder_li: key_val = {};
|
||||
let ae_promises: key_val = $state({});
|
||||
let ae_tmp: key_val = $state({});
|
||||
ae_tmp.show__file_li = true;
|
||||
ae_tmp.show__direct_download = $events_loc.pres_mgmt.show__direct_download;
|
||||
// let ae_triggers: key_val = {};
|
||||
|
||||
onMount(() => {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`Element - Manage Event File List: link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`
|
||||
);
|
||||
console.log(
|
||||
`allow_basic: ${allow_basic}; allow_moderator: ${allow_moderator}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
let clipboard_success = $state(false);
|
||||
|
||||
// PDF → Image conversion state (keyed by event_file_id)
|
||||
// WHY: Poster sessions display files in the Launcher modal via <img> tag — PDFs can't render there.
|
||||
// Presenters upload PDFs which must be converted server-side to high-res webp images.
|
||||
// Button is only shown in edit_mode for PDF files linked to a poster-type session.
|
||||
// Backend: /v3/action/hosted_file/{id}/convert_file runs pdf2image (3840px wide, first page only)
|
||||
// and saves the result as a new hosted_file record linked to the same parent object.
|
||||
type ConvertStatus = 'idle' | 'converting' | 'done' | 'error';
|
||||
let convert_status_kv: Record<string, ConvertStatus> = $state({});
|
||||
let convert_result_kv: key_val = $state({});
|
||||
|
||||
async function handle_convert_pdf_to_image(event_file_obj: key_val) {
|
||||
const file_id = event_file_obj.event_file_id;
|
||||
convert_status_kv[file_id] = 'converting';
|
||||
try {
|
||||
// Link the new image to the most specific parent available
|
||||
const link_to_type_val = event_file_obj.event_session_id ? 'event_session'
|
||||
: event_file_obj.event_presentation_id ? 'event_presentation'
|
||||
: 'event';
|
||||
const link_to_id_val = event_file_obj.event_session_id
|
||||
|| event_file_obj.event_presentation_id
|
||||
|| event_file_obj.event_id;
|
||||
const filename_no_ext = (event_file_obj.filename ?? 'poster_image').replace(/\.pdf$/i, '');
|
||||
const url = `${$ae_api.base_url}/v3/hosted_file/${event_file_obj.hosted_file_id}/convert_file`
|
||||
+ `?link_to_type=${encodeURIComponent(link_to_type_val)}`
|
||||
+ `&link_to_id=${encodeURIComponent(link_to_id_val)}`
|
||||
+ `&filename_no_ext=${encodeURIComponent(filename_no_ext)}`
|
||||
+ `&to_type=webp`;
|
||||
const resp = await fetch(url, {
|
||||
headers: {
|
||||
'x-aether-api-key': $ae_api.api_secret_key,
|
||||
'x-account-id': String($ae_api.account_id ?? '')
|
||||
}
|
||||
});
|
||||
const body = await resp.json();
|
||||
if (resp.ok && body?.data) {
|
||||
convert_result_kv[file_id] = body.data;
|
||||
convert_status_kv[file_id] = 'done';
|
||||
} else {
|
||||
console.error('[convert_pdf] API error:', body);
|
||||
convert_status_kv[file_id] = 'error';
|
||||
async function handle_convert_pdf_to_image(event_file_obj: key_val) {
|
||||
const file_id = event_file_obj.event_file_id;
|
||||
convert_status_kv[file_id] = 'converting';
|
||||
try {
|
||||
// Link the new image to the most specific parent available
|
||||
const link_to_type_val = event_file_obj.event_session_id
|
||||
? 'event_session'
|
||||
: event_file_obj.event_presentation_id
|
||||
? 'event_presentation'
|
||||
: 'event';
|
||||
const link_to_id_val =
|
||||
event_file_obj.event_session_id ||
|
||||
event_file_obj.event_presentation_id ||
|
||||
event_file_obj.event_id;
|
||||
const filename_no_ext = (
|
||||
event_file_obj.filename ?? 'poster_image'
|
||||
).replace(/\.pdf$/i, '');
|
||||
const url =
|
||||
`${$ae_api.base_url}/v3/hosted_file/${event_file_obj.hosted_file_id}/convert_file` +
|
||||
`?link_to_type=${encodeURIComponent(link_to_type_val)}` +
|
||||
`&link_to_id=${encodeURIComponent(link_to_id_val)}` +
|
||||
`&filename_no_ext=${encodeURIComponent(filename_no_ext)}` +
|
||||
`&to_type=webp`;
|
||||
const resp = await fetch(url, {
|
||||
headers: {
|
||||
'x-aether-api-key': $ae_api.api_secret_key,
|
||||
'x-account-id': String($ae_api.account_id ?? '')
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[convert_pdf] Fetch failed:', err);
|
||||
});
|
||||
const body = await resp.json();
|
||||
if (resp.ok && body?.data) {
|
||||
convert_result_kv[file_id] = body.data;
|
||||
convert_status_kv[file_id] = 'done';
|
||||
} else {
|
||||
console.error('[convert_pdf] API error:', body);
|
||||
convert_status_kv[file_id] = 'error';
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[convert_pdf] Fetch failed:', err);
|
||||
convert_status_kv[file_id] = 'error';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="float-right flex flex-row items-center">
|
||||
@@ -152,10 +174,9 @@
|
||||
// $slct_trigger = 'load__event_file_obj_li';
|
||||
// ae_tmp.show__file_li = true;
|
||||
}}
|
||||
class="btn btn-sm p-1 m-1 preset-tonal-tertiary hover:preset-tonal-warning border border-warning-500 transition hover:transition-all *:hover:inline"
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-warning border-warning-500 m-1 border p-1 transition hover:transition-all *:hover:inline"
|
||||
class:hidden={!$ae_loc.edit_mode || !$ae_loc.authenticated_access}
|
||||
title="Refresh the list of files"
|
||||
>
|
||||
title="Refresh the list of files">
|
||||
<RefreshCw size="1em" class="m-1" />
|
||||
<div class="hidden">Files</div>
|
||||
</button>
|
||||
@@ -166,10 +187,9 @@
|
||||
console.log('*** Show Alt Download button clicked ***');
|
||||
ae_tmp.show__direct_download = !ae_tmp.show__direct_download;
|
||||
}}
|
||||
class="btn btn-sm p-1 m-1 preset-tonal-tertiary hover:preset-tonal-warning border border-warning-500 transition hover:transition-all *:hover:inline"
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-warning border-warning-500 m-1 border p-1 transition hover:transition-all *:hover:inline"
|
||||
class:hidden={!$ae_loc.edit_mode || !$ae_loc.trusted_access}
|
||||
title="Toggle direct download link and copy link button"
|
||||
>
|
||||
title="Toggle direct download link and copy link button">
|
||||
<Download size="1em" class="m-1" />
|
||||
<div class="hidden">
|
||||
{ae_tmp.show__direct_download ? 'Alt On' : 'Alt Download Off'}
|
||||
@@ -179,20 +199,17 @@
|
||||
|
||||
<section
|
||||
class="svelte_component event_file_uploaded_manage {container_class_li}"
|
||||
class:text-sm={display_mode != 'default'}
|
||||
>
|
||||
class:text-sm={display_mode != 'default'}>
|
||||
<h3
|
||||
class="h6"
|
||||
class:hidden={!$lq__event_file_obj_li?.length ||
|
||||
display_mode != 'default'}
|
||||
>
|
||||
display_mode != 'default'}>
|
||||
Manage Files:
|
||||
<span
|
||||
class="font-bold bg-success-100 px-4 border rounded-lg border-success-200"
|
||||
class="bg-success-100 border-success-200 rounded-lg border px-4 font-bold"
|
||||
title="Files for {link_to_type ?? '-- not set --'}: {link_to_id ??
|
||||
'-- not set --'} (files: {$lq__event_file_obj_li?.length ??
|
||||
'None'})"
|
||||
>
|
||||
'None'})">
|
||||
<FolderOpen size="1em" class="mx-1" />
|
||||
{@html $lq__event_file_obj_li
|
||||
? `${$lq__event_file_obj_li.length}×`
|
||||
@@ -201,8 +218,8 @@
|
||||
</h3>
|
||||
|
||||
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
|
||||
<div class="overflow-auto w-full">
|
||||
<table class="table-auto w-full">
|
||||
<div class="w-full overflow-auto">
|
||||
<table class="w-full table-auto">
|
||||
{#if display_mode === 'default'}
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -211,15 +228,13 @@
|
||||
<th
|
||||
class="text-center"
|
||||
class:hidden={!allow_basic &&
|
||||
!$ae_loc.trusted_access}>Options</th
|
||||
>
|
||||
!$ae_loc.trusted_access}>Options</th>
|
||||
{/if}
|
||||
{#if display_mode === 'default'}
|
||||
<th
|
||||
class="text-center"
|
||||
class:hidden={!allow_basic &&
|
||||
!$ae_loc.trusted_access}>Status</th
|
||||
>
|
||||
!$ae_loc.trusted_access}>Status</th>
|
||||
{/if}
|
||||
<th class="text-center">Meta</th>
|
||||
</tr>
|
||||
@@ -228,11 +243,12 @@
|
||||
|
||||
<tbody>
|
||||
{#each $lq__event_file_obj_li as event_file_obj (event_file_obj.event_file_id)}
|
||||
{@const ExtIcon = ae_util.file_extension_icon_lucide(event_file_obj.extension)}
|
||||
{@const ExtIcon = ae_util.file_extension_icon_lucide(
|
||||
event_file_obj.extension
|
||||
)}
|
||||
<tr
|
||||
class="ae_obj obj_event_file border-t border-b border-surface-200-800 hover:bg-surface-100-900 hover:border-surface-300-700 transition-colors duration-200"
|
||||
class:dim={event_file_obj?.hide}
|
||||
>
|
||||
class="ae_obj obj_event_file border-surface-200-800 hover:bg-surface-100-900 hover:border-surface-300-700 border-t border-b transition-colors duration-200"
|
||||
class:dim={event_file_obj?.hide}>
|
||||
<td class="event_file__file align-middle">
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename != event_file_obj.event_file_id}
|
||||
<div class="flex flex-col gap-2">
|
||||
@@ -242,8 +258,7 @@
|
||||
show_divider={true}
|
||||
show_direct_download={ae_tmp.show__direct_download}
|
||||
max_filename={30}
|
||||
classes="btn btn-sm lg:btn-md preset-tonal-primary hover:preset-filled-primary-500 min-w-72 lg:min-w-96"
|
||||
/>
|
||||
classes="btn btn-sm lg:btn-md preset-tonal-primary hover:preset-filled-primary-500 min-w-72 lg:min-w-96" />
|
||||
|
||||
<!-- PDF → webp convert button: only for poster sessions in edit mode -->
|
||||
{#if $ae_loc.edit_mode && event_file_obj?.extension === 'pdf' && (event_file_obj?.event_session_type_code === 'poster' || context_session_type_code === 'poster')}
|
||||
@@ -251,33 +266,54 @@
|
||||
{#if !convert_status_kv[event_file_obj.event_file_id] || convert_status_kv[event_file_obj.event_file_id] === 'idle'}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm preset-tonal-warning border border-warning-500"
|
||||
class="btn btn-sm preset-tonal-warning border-warning-500 border"
|
||||
title="Convert this PDF to a high-res webp image for use in the Launcher poster display."
|
||||
onclick={() => handle_convert_pdf_to_image(event_file_obj)}
|
||||
>
|
||||
<FileImage size="1em" class="mx-1" />
|
||||
onclick={() =>
|
||||
handle_convert_pdf_to_image(
|
||||
event_file_obj
|
||||
)}>
|
||||
<FileImage
|
||||
size="1em"
|
||||
class="mx-1" />
|
||||
Convert PDF → Image
|
||||
</button>
|
||||
{:else if convert_status_kv[event_file_obj.event_file_id] === 'converting'}
|
||||
<span class="btn btn-sm preset-tonal-surface opacity-60 cursor-wait">
|
||||
<LoaderCircle size="1em" class="mx-1 animate-spin" />
|
||||
<span
|
||||
class="btn btn-sm preset-tonal-surface cursor-wait opacity-60">
|
||||
<LoaderCircle
|
||||
size="1em"
|
||||
class="mx-1 animate-spin" />
|
||||
Converting…
|
||||
</span>
|
||||
{:else if convert_status_kv[event_file_obj.event_file_id] === 'done'}
|
||||
<span class="btn btn-sm preset-tonal-success" title="Conversion complete. New webp hosted_file created: {convert_result_kv[event_file_obj.event_file_id]?.filename ?? ''}">
|
||||
<Check size="1em" class="mx-1" />
|
||||
Done — {convert_result_kv[event_file_obj.event_file_id]?.filename ?? 'image created'}
|
||||
<span
|
||||
class="btn btn-sm preset-tonal-success"
|
||||
title="Conversion complete. New webp hosted_file created: {convert_result_kv[
|
||||
event_file_obj
|
||||
.event_file_id
|
||||
]?.filename ?? ''}">
|
||||
<Check
|
||||
size="1em"
|
||||
class="mx-1" />
|
||||
Done — {convert_result_kv[
|
||||
event_file_obj
|
||||
.event_file_id
|
||||
]?.filename ??
|
||||
'image created'}
|
||||
</span>
|
||||
{:else if convert_status_kv[event_file_obj.event_file_id] === 'error'}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm preset-tonal-error border border-error-500"
|
||||
class="btn btn-sm preset-tonal-error border-error-500 border"
|
||||
title="Conversion failed. Click to retry."
|
||||
onclick={() => {
|
||||
convert_status_kv[event_file_obj.event_file_id] = 'idle';
|
||||
}}
|
||||
>
|
||||
<TriangleAlert size="1em" class="mx-1" />
|
||||
convert_status_kv[
|
||||
event_file_obj.event_file_id
|
||||
] = 'idle';
|
||||
}}>
|
||||
<TriangleAlert
|
||||
size="1em"
|
||||
class="mx-1" />
|
||||
Failed — Retry?
|
||||
</button>
|
||||
{/if}
|
||||
@@ -286,14 +322,11 @@
|
||||
|
||||
{#if ae_tmp.show__direct_download}
|
||||
<div
|
||||
class="px-4 py-2 flex flex-col gap-0.5 bg-surface-100/50 rounded-lg border border-surface-500/10"
|
||||
>
|
||||
class="bg-surface-100/50 border-surface-500/10 flex flex-col gap-0.5 rounded-lg border px-4 py-2">
|
||||
<div
|
||||
class="flex flex-row items-center gap-2"
|
||||
>
|
||||
class="flex flex-row items-center gap-2">
|
||||
<span
|
||||
class="text-[10px] font-bold uppercase opacity-50 w-24"
|
||||
>
|
||||
class="w-24 text-[10px] font-bold uppercase opacity-50">
|
||||
Access Link:
|
||||
</span>
|
||||
<MyClipboard
|
||||
@@ -329,9 +362,8 @@
|
||||
.tmp_val__filename_no_ext
|
||||
}
|
||||
data-original_value={event_file_obj.filename}
|
||||
class="input min-w-72 lg:min-w-96 text-sm bg-warning-100"
|
||||
title="Rename this file. No extension."
|
||||
/>
|
||||
class="input bg-warning-100 min-w-72 text-sm lg:min-w-96"
|
||||
title="Rename this file. No extension." />
|
||||
{#if $events_sess.pres_mgmt.tmp_val__filename_no_ext.trim() != event_file_obj.filename_no_ext}
|
||||
<button
|
||||
type="button"
|
||||
@@ -389,15 +421,17 @@
|
||||
);
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-success"
|
||||
title="Save changes"
|
||||
>
|
||||
title="Save changes">
|
||||
{#await ae_promises.update__event_file_obj}
|
||||
<LoaderCircle size="1em" class="mx-1 animate-spin" />
|
||||
<LoaderCircle
|
||||
size="1em"
|
||||
class="mx-1 animate-spin" />
|
||||
<span class=""
|
||||
>Saving {event_file_obj.extension}</span
|
||||
>
|
||||
>Saving {event_file_obj.extension}</span>
|
||||
{:then}
|
||||
<Save size="1em" class="mx-1" />
|
||||
<Save
|
||||
size="1em"
|
||||
class="mx-1" />
|
||||
Save {event_file_obj.extension}
|
||||
filename?
|
||||
{/await}
|
||||
@@ -411,8 +445,7 @@
|
||||
<td
|
||||
class="event_file__options"
|
||||
class:hidden={!allow_basic &&
|
||||
!$ae_loc.trusted_access}
|
||||
>
|
||||
!$ae_loc.trusted_access}>
|
||||
<div class="flex flex-col gap-1 text-sm">
|
||||
<button
|
||||
type="button"
|
||||
@@ -439,8 +472,7 @@
|
||||
.pres_mgmt
|
||||
.show_field_edit__filename ==
|
||||
event_file_obj.event_file_id}
|
||||
title={`Rename this file? "${event_file_obj.filename}"}`}
|
||||
>
|
||||
title={`Rename this file? "${event_file_obj.filename}"}`}>
|
||||
<Pencil size="1em" class="mx-1" />
|
||||
{#if $events_sess.pres_mgmt?.show_field_edit__filename == event_file_obj.event_file_id}
|
||||
Cancel?
|
||||
@@ -504,22 +536,26 @@
|
||||
);
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-success"
|
||||
title="Hide this file from the presentation launcher"
|
||||
>
|
||||
title="Hide this file from the presentation launcher">
|
||||
<!-- Users see this as the "Archive" option button -->
|
||||
<!-- {@html (event_file_obj?.hide ? '<span class="fas fa-archive m-1"></span> Unarchive' : '<span class="fas fa-archive m-1"></span> Archive')}
|
||||
-->
|
||||
|
||||
{#await ae_promises.update__event_file_obj}
|
||||
<LoaderCircle size="1em" class="mx-1 animate-spin" />
|
||||
<LoaderCircle
|
||||
size="1em"
|
||||
class="mx-1 animate-spin" />
|
||||
<span class=""
|
||||
>Saving {event_file_obj.extension}</span
|
||||
>
|
||||
>Saving {event_file_obj.extension}</span>
|
||||
{:then}
|
||||
{#if event_file_obj.hide}
|
||||
<Eye size="1em" class="m-1" /> Unhide File
|
||||
<Eye
|
||||
size="1em"
|
||||
class="m-1" /> Unhide File
|
||||
{:else}
|
||||
<EyeOff size="1em" class="m-1" /> Hide
|
||||
<EyeOff
|
||||
size="1em"
|
||||
class="m-1" /> Hide
|
||||
{/if}
|
||||
{/await}
|
||||
</button>
|
||||
@@ -550,8 +586,7 @@
|
||||
);
|
||||
}}
|
||||
class="btn btn-sm preset-tonal-tertiary hover:preset-tonal-success"
|
||||
title="Delete this file"
|
||||
>
|
||||
title="Delete this file">
|
||||
<Trash2 size="1em" class="mx-1" />
|
||||
<!-- <span class="fas fa-minus mx-1"></span> -->
|
||||
Delete
|
||||
@@ -564,16 +599,18 @@
|
||||
<td
|
||||
class="event_file__status"
|
||||
class:hidden={!allow_basic &&
|
||||
!$ae_loc.trusted_access}
|
||||
>
|
||||
!$ae_loc.trusted_access}>
|
||||
<div
|
||||
class="flex flex-col gap-1 items-center justify-center text-sm"
|
||||
>
|
||||
class="flex flex-col items-center justify-center gap-1 text-sm">
|
||||
<div class="">
|
||||
{#if event_file_obj.open_in_os == 'win'}
|
||||
MS Windows <Monitor size="1em" class="inline-block" />
|
||||
MS Windows <Monitor
|
||||
size="1em"
|
||||
class="inline-block" />
|
||||
{:else if event_file_obj.open_in_os == 'mac'}
|
||||
Apple macOS <Laptop size="1em" class="inline-block" />
|
||||
Apple macOS <Laptop
|
||||
size="1em"
|
||||
class="inline-block" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -581,8 +618,7 @@
|
||||
<div>
|
||||
<label
|
||||
for="file_purpose"
|
||||
class="text-sm mx-1 hidden"
|
||||
>
|
||||
class="mx-1 hidden text-sm">
|
||||
Purpose:
|
||||
</label>
|
||||
<select
|
||||
@@ -633,25 +669,28 @@
|
||||
|
||||
// ae_triggers.update_event_file_purpose = true;
|
||||
}}
|
||||
class="select min-w-fit max-w-fit text-xs mx-1 border border-surface-300-700 rounded-md p-1 bg-surface-50-900 hover:border-surface-400-600 transition-colors duration-200"
|
||||
>
|
||||
class="select border-surface-300-700 bg-surface-50-900 hover:border-surface-400-600 mx-1 max-w-fit min-w-fit rounded-md border p-1 text-xs transition-colors duration-200">
|
||||
<option
|
||||
value={null}
|
||||
selected={!event_file_obj.file_purpose}
|
||||
>-- purpose not set --</option
|
||||
>
|
||||
>-- purpose not set --</option>
|
||||
{#if $events_loc.pres_mgmt?.file_purpose_option_kv}
|
||||
{#each Object.entries($events_loc.pres_mgmt.file_purpose_option_kv as any) as [key, file_purpose_option] (key)}
|
||||
<option
|
||||
value={key}
|
||||
selected={event_file_obj.file_purpose ===
|
||||
key}
|
||||
disabled={(file_purpose_option as any)?.disabled &&
|
||||
disabled={(
|
||||
file_purpose_option as any
|
||||
)?.disabled &&
|
||||
!$ae_loc.edit_mode}
|
||||
class:hidden={(file_purpose_option as any)?.hidden &&
|
||||
!$ae_loc.edit_mode}
|
||||
>
|
||||
{(file_purpose_option as any)?.name}
|
||||
class:hidden={(
|
||||
file_purpose_option as any
|
||||
)?.hidden &&
|
||||
!$ae_loc.edit_mode}>
|
||||
{(
|
||||
file_purpose_option as any
|
||||
)?.name}
|
||||
</option>
|
||||
{/each}
|
||||
{/if}
|
||||
@@ -675,16 +714,16 @@
|
||||
<!-- {event_file_obj.hosted_file_content_type} -->
|
||||
|
||||
<span
|
||||
class="w-full flex flex-col lg:flex-row justify-between"
|
||||
>
|
||||
class="flex w-full flex-col justify-between lg:flex-row">
|
||||
<span
|
||||
class:hidden={display_mode !=
|
||||
'default'}
|
||||
>
|
||||
'default'}>
|
||||
Type:
|
||||
<strong
|
||||
>{event_file_obj.extension}
|
||||
<ExtIcon size="1em" class="inline-block" />
|
||||
<ExtIcon
|
||||
size="1em"
|
||||
class="inline-block" />
|
||||
</strong>
|
||||
<!-- {#if event_file_obj.open_in_os == 'win'}
|
||||
<strong>
|
||||
@@ -699,28 +738,23 @@
|
||||
<span>
|
||||
<span
|
||||
class:hidden={display_mode !=
|
||||
'default'}
|
||||
>
|
||||
'default'}>
|
||||
Size:
|
||||
</span>
|
||||
<strong
|
||||
>{ae_util.format_bytes(
|
||||
event_file_obj.file_size
|
||||
)}</strong
|
||||
>
|
||||
)}</strong>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span
|
||||
class="w-full flex flex-col lg:flex-row justify-between"
|
||||
>
|
||||
class="flex w-full flex-col justify-between lg:flex-row">
|
||||
<span
|
||||
title="SHA 256: {event_file_obj.hash_sha256}"
|
||||
>
|
||||
title="SHA 256: {event_file_obj.hash_sha256}">
|
||||
<span
|
||||
class:hidden={display_mode !=
|
||||
'default'}
|
||||
>
|
||||
'default'}>
|
||||
Hash:
|
||||
</span>
|
||||
<strong
|
||||
@@ -729,22 +763,18 @@
|
||||
>{event_file_obj.hash_sha256.slice(
|
||||
0,
|
||||
10
|
||||
)}…</strong
|
||||
>
|
||||
)}…</strong>
|
||||
</span>
|
||||
<span
|
||||
class:hidden={!$ae_loc.administrator_access ||
|
||||
display_mode != 'default'}
|
||||
>
|
||||
display_mode != 'default'}>
|
||||
<span
|
||||
class:hidden={display_mode !=
|
||||
'default'}
|
||||
>
|
||||
'default'}>
|
||||
ID:
|
||||
</span>
|
||||
<strong
|
||||
>{event_file_obj.hosted_file_id}</strong
|
||||
>
|
||||
>{event_file_obj.hosted_file_id}</strong>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
@@ -770,8 +800,7 @@
|
||||
event_file_obj?.created_on,
|
||||
minutes: 2880
|
||||
}
|
||||
)}
|
||||
>
|
||||
)}>
|
||||
{#if display_mode == 'default'}
|
||||
<!-- <span class="fas fa-cloud-upload-alt mx-1"></span> -->
|
||||
<!-- Uploaded: -->
|
||||
@@ -792,8 +821,7 @@
|
||||
>{ae_util.iso_datetime_formatter(
|
||||
event_file_obj.created_on,
|
||||
'time_12_short_no_leading'
|
||||
)}</strong
|
||||
>
|
||||
)}</strong>
|
||||
<!-- {event_file_obj.updated_on} -->
|
||||
{:else}
|
||||
<!-- <span class="fas fa-calendar-day mx-1"></span> -->
|
||||
@@ -807,8 +835,7 @@
|
||||
>{ae_util.iso_datetime_formatter(
|
||||
event_file_obj.created_on,
|
||||
'time_12_short_no_leading'
|
||||
)}</strong
|
||||
>
|
||||
)}</strong>
|
||||
</strong>
|
||||
{/if}
|
||||
</span>
|
||||
@@ -822,8 +849,7 @@
|
||||
{:else}
|
||||
<p
|
||||
class="w-96 text-center text-gray-500"
|
||||
class:hidden={display_mode != 'default'}
|
||||
>
|
||||
class:hidden={display_mode != 'default'}>
|
||||
No files uploaded to display
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user