More work on the Launcher and related

This commit is contained in:
Scott Idem
2025-09-17 16:36:04 -04:00
parent c9e9fbec79
commit 60fbfc434e
7 changed files with 341 additions and 365 deletions

View File

@@ -146,239 +146,267 @@ ae_promises[$events_slct.event_session_id] = events_func.load_ae_obj_li__event_p
event_launcher_session_view
grow h-full w-full
space-y-1
relative
"
>
<!-- <slot name="event_session_message">event session message</slot> -->
{#if $lq__event_session_obj && $lq__event_session_obj.event_session_id_random}
<header class="event_session_about text-center border-b-2 border-gray-400">
{#if $events_sess.launcher.loading__session_id_status}
<span class="absolute top-0 right-0 text-sm text-center text-gray-400">
<span class="fas fa-spinner fa-spin"></span>
Loading session information...
</span>
<!-- {:else}
<span class="absolute top-0 right-0 text-sm text-center text-gray-400">
Session loaded?
</span> -->
{/if}
<h3
class="event_session_datetimes"
{#if $lq__event_session_obj && $lq__event_session_obj.event_session_id_random}
<header class="event_session_about text-center border-b-2 border-gray-400">
<h3
class="event_session_datetimes"
>
<button
type="button"
onclick={() => {
if ($events_loc.launcher.time_format == 'time_12_short') {
// $events_loc.launcher.datetime_format = 'datetime_long';
$events_loc.launcher.time_format = 'time_short';
$events_loc.launcher.time_hours = 24;
} else {
$events_loc.launcher.time_format = 'time_12_short';
// $events_loc.launcher.datetime_format = 'datetime_12_long';
$events_loc.launcher.time_hours = 12;
}
}}
>
<strong>{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'week_long')}</strong>
<span class="font-normal">
{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'date_long_month_day')}
</span>
<strong>{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, $events_loc.launcher.time_format)}</strong>
<span class="font-normal">
{ae_util.iso_datetime_formatter($lq__event_session_obj.end_datetime, $events_loc.launcher.time_format)}
</span>
</button>
</h3>
<h2 class="text-xl">
{$lq__event_session_obj?.name}
{#if $lq__event_session_obj?.code}
<span class="text-base text-gray-500 font-normal p-1"
title="Session code {$lq__event_session_obj.code}"
>
<span class="fas fa-barcode"></span>
{$lq__event_session_obj?.code}
</span>
{/if}
</h2>
</header>
<!-- <section class="event_session_description text-xs" class:d_none="{hide_description}">
{@html $lq__event_session_obj.description}
</section> -->
{#if !$lq__event_session_obj?.file_count_all}
<p class="text-2xl text-center text-red-500 font-bold">
<span class="fas fa-exclamation-triangle"></span>
Warning
<span class="fas fa-exclamation-triangle"></span>
<br>
No files available show for this session.
</p>
{/if}
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
<section class="event_session_file_list">
<div>
<div class="text-xs text-surface-600-400">
<strong>
<span class="fas fa-file-archive"></span>
Session Files:
<span class:hidden={!$ae_loc.trusted_access || !$ae_loc.edit_mode}>
({$lq__event_file_obj_li?.length}&times;)
</span>
</strong>
</div>
<!-- {#if $ae_loc.trusted_access || $events_loc.launcher.trusted_access}
<button on:click={async () => {
show_modal_upload_files = true;
link_to_type = 'event_session';
link_to_id = $lq__event_session_obj.event_session_id_random;
}}
type="button" class="ae_btn btn_outline_warning btn_xs" title="Upload updated or additional files"
>
<span class="fas fa-upload"></span> Upload Session File(s)
</button>
{/if} -->
</div>
<ul>
{#each $lq__event_file_obj_li as event_file_obj, index}
<li
class="flex flex-row justify-center gap-1"
class:hidden={!$events_loc.launcher.show_content__hidden_files && event_file_obj.hide}
>
<button
type="button"
disabled={!$ae_loc.trusted_access}
onclick={() => {
if ($events_loc.launcher.time_format == 'time_12_short') {
// $events_loc.launcher.datetime_format = 'datetime_long';
$events_loc.launcher.time_format = 'time_short';
$events_loc.launcher.time_hours = 24;
} else {
$events_loc.launcher.time_format = 'time_12_short';
// $events_loc.launcher.datetime_format = 'datetime_12_long';
$events_loc.launcher.time_hours = 12;
}
// ae_promises[event_file_obj.event_file_id_random]
ae_promises[event_file_obj.event_file_id_random] = api.download_hosted_file({
api_cfg: $ae_api,
hosted_file_id: event_file_obj.hosted_file_id_random,
return_file: true,
filename: event_file_obj.filename,
auto_download: true,
log_lvl: 0
});
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id_random, filename: event_file_obj.filename, auto_download: true }, '*');
}}
class="btn btn-sm lg:btn-md preset-tonal-secondary hover:preset-filled-primary-500 min-w-72 lg:min-w-96
transition-all
"
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
>
<strong>{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'week_long')}</strong>
<span class="font-normal">
{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'date_long_month_day')}
</span>
<strong>{ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, $events_loc.launcher.time_format)}</strong>
<span class="font-normal">
{ae_util.iso_datetime_formatter($lq__event_session_obj.end_datetime, $events_loc.launcher.time_format)}
</span>
</button>
</h3>
<h2 class="text-xl">
{$lq__event_session_obj?.name}
{#if $lq__event_session_obj?.code}
<span class="text-base text-gray-500 font-normal p-1"
title="Session code {$lq__event_session_obj.code}"
>
<span class="fas fa-barcode"></span>
{$lq__event_session_obj?.code}
</span>
{/if}
</h2>
</header>
<!-- <section class="event_session_description text-xs" class:d_none="{hide_description}">
{@html $lq__event_session_obj.description}
</section> -->
{#if !$lq__event_session_obj?.file_count_all}
<p class="text-2xl text-center text-red-500 font-bold">
<span class="fas fa-exclamation-triangle"></span>
Warning
<span class="fas fa-exclamation-triangle"></span>
<br>
No files available show for this session.
</p>
{/if}
{#if $lq__event_file_obj_li && $lq__event_file_obj_li.length}
<section class="event_session_file_list">
<div>
<div class="text-xs"><strong>
<span class="fas fa-file-archive"></span>
Session Files:
{#if $ae_loc.administrator_access}
({$lq__event_file_obj_li?.length})
{/if}
</strong></div>
<!-- {#if $ae_loc.trusted_access || $events_loc.launcher.trusted_access}
<button on:click={async () => {
show_modal_upload_files = true;
link_to_type = 'event_session';
link_to_id = $lq__event_session_obj.event_session_id_random;
}}
type="button" class="ae_btn btn_outline_warning btn_xs" title="Upload updated or additional files"
>
<span class="fas fa-upload"></span> Upload Session File(s)
</button>
{/if} -->
</div>
<ul>
{#each $lq__event_file_obj_li as event_file_obj, index}
<li
class="flex flex-row justify-center gap-1"
class:hidden={!$events_loc.launcher.show_content__hidden_files && event_file_obj.hide}
>
<button
disabled={!$ae_loc.trusted_access}
onclick={() => {
// ae_promises[event_file_obj.event_file_id_random]
ae_promises[event_file_obj.event_file_id_random] = api.download_hosted_file({
api_cfg: $ae_api,
hosted_file_id: event_file_obj.hosted_file_id_random,
return_file: true,
filename: event_file_obj.filename,
auto_download: true,
log_lvl: 0
});
// window.postMessage({ type: 'download_event_file', event_file_id: event_file_obj.event_file_id_random, filename: event_file_obj.filename, auto_download: true }, '*');
}}
class="btn btn-sm lg:btn-md preset-tonal-secondary hover:preset-filled-primary-500 min-w-72 lg:min-w-96"
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
>
{#await ae_promises[event_file_obj.event_file_id_random]}
<span class="fas fa-spinner fa-spin mx-1"></span>
<span class="">
Downloading
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]}
{$ae_sess.api_download_kv[event_file_obj.hosted_file_id_random].percent_completed}%
{/if}
:
</span>
{:then}
<!-- <span class="fas fa-download mx-1"></span> -->
<span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)}"></span>
<!-- <span class="text-sm">
Download:
</span> -->
{/await}
<span class="grow">
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: 30})}
</span>
<span
class="badge preset-tonal-success hover:preset-filled-success-500 text-sm"
class:hidden={!event_file_obj.file_purpose}
>
{event_file_obj.file_purpose}
</span>
</button>
<!-- <Launcher_file_cont {event_file_obj} hide_created_on={false} show_bak_download={($ae_loc.trusted_access || $events_loc.launcher.trusted_access)} open_file_as={$lq__event_session_obj.type_code} poster_title={$lq__event_session_obj.title} /> -->
<!-- <a
href="{$ae_api.base_url}/event/file/{event_file_obj.event_file_id_random}/download?filename={event_file_obj.filename}&x_no_account_id_token=direct-download"
class="btn btn-sm variant-soft-secondary m-0.5 *:hover:inline"
class:hidden={!ae_tmp.show__direct_download}
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
>
<span class="fas fa-download mx-1"></span>
<div class="hidden">
Download
</div>
</a> -->
</li>
{/each}
</ul>
</section>
{/if}
<!-- <hr class="w-full border border-gray-200" /> -->
<section class="event_presentation_list">
<!-- {$lq__event_session_obj?.event_presentation_li?.length ?? 'loading...?'} -->
{#if $lq__event_presentation_obj_li}
<div class="text-xs"><strong>
{#if $lq__event_session_obj.type_code == 'poster'}
<span class="fas fa-image"></span>
Posters:
{:else}
<span class="fas fa-tv"></span>
Presentations:
{/if}
{#if $ae_loc.administrator_access}
({$lq__event_presentation_obj_li?.length})
{/if}
</strong></div>
<!-- Maybe set max with? max-w-(--breakpoint-md) -->
<ul class="event_presentation_list max-w-full space-y-2">
{#each $lq__event_presentation_obj_li as event_presentation_obj}
<li class="border-b-2 border-gray-300 my-1 py-1 text-center md:text-left">
<!-- The presentation information -->
<div class="event_presentation_datetime_name flex flex-row justify-evenly gap-4">
<!-- <div class="event_presentation_datetime_name"> -->
{#if event_presentation_obj?.start_datetime}
<span class="event_presentation_datetime"><strong>{ae_util.iso_datetime_formatter(event_presentation_obj?.start_datetime, 'time_12_short_no_leading')}</strong></span>
{#await ae_promises[event_file_obj.event_file_id_random]}
<span class="fas fa-spinner fa-spin mx-1"></span>
<span class="">
Downloading
{#if $ae_sess.api_download_kv[event_file_obj.hosted_file_id_random]}
{$ae_sess.api_download_kv[event_file_obj.hosted_file_id_random].percent_completed}%
{/if}
:
</span>
{:then}
<!-- <span class="fas fa-download mx-1"></span> -->
<span class="fas fa-{ae_util.file_extension_icon(event_file_obj.extension)}"></span>
<!-- <span class="text-sm">
Download:
</span> -->
{/await}
<span class="event_presentation_name grow">{event_presentation_obj?.name}</span>
<!-- </div> -->
<span class="grow">
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: 30})}
</span>
<span
class="badge preset-tonal-success hover:preset-filled-success-500 text-sm"
class:hidden={!event_file_obj.file_purpose}
>
{event_file_obj.file_purpose}
</span>
</button>
<!-- <Launcher_file_cont {event_file_obj} hide_created_on={false} show_bak_download={($ae_loc.trusted_access || $events_loc.launcher.trusted_access)} open_file_as={$lq__event_session_obj.type_code} poster_title={$lq__event_session_obj.title} /> -->
<!-- <a
href="{$ae_api.base_url}/event/file/{event_file_obj.event_file_id_random}/download?filename={event_file_obj.filename}&x_no_account_id_token=direct-download"
class="btn btn-sm variant-soft-secondary m-0.5 *:hover:inline"
class:hidden={!ae_tmp.show__direct_download}
title={`Download this file:\n${event_file_obj.filename}\n[API] SHA256: ${event_file_obj.hash_sha256.slice(0, 10)}... Hosted ID: ${event_file_obj.hosted_file_id_random} Event File ID: ${event_file_obj.event_file_id_random}`}
>
<span class="fas fa-download mx-1"></span>
<div class="hidden">
Download
</div>
<!-- The presenter list -->
{#if $lq__event_presenter_obj_li && $lq__event_presenter_obj_li.length}
<ul class="event_presentation_presenter_list">
{#each $lq__event_presenter_obj_li as event_presenter_obj, index}
{#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random}
<li>
{#if $lq__event_session_obj.type_code == 'poster'}
<Launcher_presenter_view_posters
lq__event_presenter_obj={event_presenter_obj}
/>
{:else}
<Launcher_presenter_view
lq__event_presenter_obj={event_presenter_obj}
/>
{/if}
</li>
{/if}
{/each}
</ul>
{:else}
<span class="event_launcher_no_presenters">No presenters to display</span>
{/if}
</li>
{/each}
</ul>
{:else}
<p>No presentations available to display.</p>
{/if}
</section>
{:else}
<span class="fas fa-spinner fa-spin"></span>
No session selected
</a> -->
</li>
{/each}
</ul>
</section>
{/if}
<!-- <hr class="w-full border border-gray-200" /> -->
<section class="event_presentation_list">
<!-- {$lq__event_session_obj?.event_presentation_li?.length ?? 'loading...?'} -->
{#if $lq__event_presentation_obj_li}
<div class="text-xs text-surface-600-400"><strong>
{#if $lq__event_session_obj.type_code == 'poster'}
<span class="fas fa-image"></span>
Posters:
{:else}
<span class="fas fa-tv"></span>
Presentations:
{/if}
{#if $ae_loc.administrator_access && $ae_loc.edit_mode}
({$lq__event_presentation_obj_li?.length}&times;)
{/if}
</strong></div>
<!-- Maybe set max with? max-w-(--breakpoint-md) -->
<ul class="event_presentation_list max-w-full space-y-2">
{#each $lq__event_presentation_obj_li as event_presentation_obj}
<li class="border-b-2 border-gray-300 my-1 py-1 text-center md:text-left">
<!-- The presentation information -->
<div class="event_presentation_datetime_name flex flex-row justify-evenly gap-4">
<!-- <div class="event_presentation_datetime_name"> -->
{#if event_presentation_obj?.start_datetime}
<span class="event_presentation_datetime"><strong>{ae_util.iso_datetime_formatter(event_presentation_obj?.start_datetime, 'time_12_short_no_leading')}</strong></span>
{/if}
<span class="event_presentation_name grow">{event_presentation_obj?.name}</span>
<!-- </div> -->
</div>
<!-- The presenter list -->
{#if $lq__event_presenter_obj_li && $lq__event_presenter_obj_li.length}
<ul class="event_presentation_presenter_list">
{#each $lq__event_presenter_obj_li as event_presenter_obj, index}
{#if event_presenter_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random}
<li
class="
border border-transparent
rounded-lg
hover:bg-surface-100-900
hover:border-surface-400-600
p-1
transition-all
"
>
{#if $lq__event_session_obj.type_code == 'poster'}
<Launcher_presenter_view_posters
lq__event_presenter_obj={event_presenter_obj}
/>
{:else}
<Launcher_presenter_view
lq__event_presenter_obj={event_presenter_obj}
/>
{/if}
</li>
{/if}
{/each}
</ul>
{:else}
<span class="event_launcher_no_presenters">No presenters to display</span>
{/if}
</li>
{/each}
</ul>
{:else}
<p>No presentations available to display.</p>
{/if}
</section>
{:else}
<span class="fas fa-spinner fa-spin"></span>
No session selected
{/if}
</div>