More work on the new Launcher. Wrapping up for the day.

This commit is contained in:
Scott Idem
2025-07-21 20:36:44 -04:00
parent 2e39c5f67b
commit 1d840052c7
7 changed files with 189 additions and 81 deletions

View File

@@ -2,6 +2,7 @@
interface Props {
data_url: any;
lq__event_obj: any;
lq__event_event_file_obj_li: any;
lq__location_event_file_obj_li: any;
// lq__event_location_obj: any;
// export let lq__event_location_obj_li: any;
@@ -15,6 +16,7 @@ interface Props {
let {
data_url,
lq__event_obj,
lq__event_event_file_obj_li,
lq__location_event_file_obj_li,
// lq__event_location_obj,
lq__event_location_obj_li,
@@ -74,67 +76,69 @@ let ae_promises: key_val = $state({
</script>
<section class="text-center space-y-1">
<h2 class="">{$lq__event_obj?.cfg_json.short_name ?? 'loading...'}</h2>
<button
onclick={() => {
$events_loc.launcher.show_content__hidden_files = !$events_loc.launcher.show_content__hidden_files;
}}
<section
class="
btn btn-sm
text-xs
py-1 px-2
preset-outlined-warning-200-800 preset-filled-warning-50-950
hover:preset-outlined-success-200-800 hover:preset-filled-success-100-900
w-1/2
transition-all
flex flex-col gap-1 items-center justify-center
text-center
w-full max-w-full
"
>
{#if $events_loc.launcher.show_content__hidden_files}
<span class="fas fa-eye-slash m-1"></span>
Hide Files
{:else}
<span class="fas fa-eye m-1"></span>
All Files?
{/if}
>
</button>
<button
onclick={() => {
$events_loc.launcher.show_content__hidden_sessions = !$events_loc.launcher.show_content__hidden_sessions;
}}
class="
btn btn-sm
text-xs
py-1 px-2
preset-outlined-warning-200-800 preset-filled-warning-50-950
hover:preset-outlined-success-200-800 hover:preset-filled-success-100-900
w-1/2
transition-all
"
>
{#if $events_loc.launcher.show_content__hidden_sessions}
<span class="fas fa-eye-slash m-1"></span>
Hide Sessions
{:else}
<span class="fas fa-eye m-1"></span>
All Sessions?
{/if}
</button>
<!-- <h2 class="text-sm font-semibold">{$lq__event_obj?.cfg_json.short_name ?? 'loading...'}</h2> -->
{#if $lq__event_event_file_obj_li}
<div class="w-full text-center">
<!-- <div class="text-xs text-neutral-800/80">
<strong>
Event Files:
{#if $ae_loc.administrator_access}
({$lq__event_event_file_obj_li?.length}&times;)
{/if}
</strong>
</div> -->
{#each $lq__event_event_file_obj_li as event_file_obj, index}
<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
});
}}
class="
btn btn-sm
text-xs w-full
preset-tonal-primary
hover:preset-tonal-success
transition-all
"
>
<span class="fas fa-file-archive m-1 text-neutral-800/80"></span>
{event_file_obj?.filename}
</button>
{/each}
</div>
{/if}
{#if $ae_loc.edit_mode}
{#if $lq__event_location_obj_li && $lq__event_location_obj_li.length > 0}
<div class="text-xs"><strong>
<div class="text-xs text-neutral-800/80"><strong>
Locations:
{#if $ae_loc.administrator_access}
({$lq__event_location_obj_li?.length})
({$lq__event_location_obj_li?.length}&times;)
{/if}
<!-- This should fade out once the data is loaded. -->
{#await ae_promises[slct_event_location_id]}
<span class="fas fa-spinner fa-spin text-blue-500"></span>
{:then result}
<span class="fas fa-check text-green-500"></span>
<span class="fas fa-check text-green-500/80"></span>
{/await}
</strong></div>
<select
@@ -217,13 +221,17 @@ let ae_promises: key_val = $state({
{/each}
</select>
{:else}
<p class="text-sm">
<div class="text-sm">
No locations found.
Event ID: {$lq__event_obj?.id}
</p>
(Event ID: {$lq__event_obj?.id})
</div>
{/if}
{/if}
{#if $lq__location_event_file_obj_li}
<div class="w-full text-center">
{#each $lq__location_event_file_obj_li as event_file_obj, index}
<button
disabled={!$ae_loc.trusted_access}
@@ -238,18 +246,25 @@ let ae_promises: key_val = $state({
log_lvl: 0
});
}}
class="btn btn-sm preset-tonal-primary border border-primary-500 hover:preset-filled-primary-500 text-xs py-1 px-2 w-full"
class="
btn btn-sm
text-xs w-full
preset-tonal-primary
hover:preset-tonal-success
transition-all
"
>
<span class="fas fa-file-archive m-1"></span>
{event_file_obj?.filename}aa
<span class="fas fa-file-archive m-1 text-neutral-800/80"></span>
{event_file_obj?.filename}
</button>
{/each}
</div>
{/if}
</section>
<section class="text-center">
<section class="text-center w-full max-w-full">
{#if $lq__event_session_obj_li}
<Menu_session_list_menu
@@ -260,4 +275,50 @@ let ae_promises: key_val = $state({
</section>
<!-- {/await} -->
{#if $ae_loc.edit_mode}
<section class="flex flex-row gap-2 items-center justify-center w-full max-w-full">
<button
onclick={() => {
$events_loc.launcher.show_content__hidden_files = !$events_loc.launcher.show_content__hidden_files;
}}
class="
btn btn-sm
text-xs
w-1/2 max-w-1/2
preset-tonal-warning
hover:preset-tonal-success
transition-all
"
>
{#if $events_loc.launcher.show_content__hidden_files}
<span class="fas fa-eye-slash m-1 text-neutral-800/80"></span>
Hide Files
{:else}
<span class="fas fa-eye m-1 text-neutral-800/80"></span>
All Files
{/if}
</button>
<button
onclick={() => {
$events_loc.launcher.show_content__hidden_sessions = !$events_loc.launcher.show_content__hidden_sessions;
}}
class="
btn btn-sm
text-xs
w-1/2 max-w-1/2
preset-tonal-warning
hover:preset-tonal-success
transition-all
"
>
{#if $events_loc.launcher.show_content__hidden_sessions}
<span class="fas fa-eye-slash m-1 text-neutral-800/80"></span>
Hide Sessions
{:else}
<span class="fas fa-eye m-1 text-neutral-800/80"></span>
All Sessions
{/if}
</button>
</section>
{/if}