Now with ability to clear IDB event_file list
This commit is contained in:
@@ -64,10 +64,20 @@ onMount(() => {
|
||||
type="button"
|
||||
on:click={() => {
|
||||
console.log('*** Refresh button clicked ***');
|
||||
ae_tmp.show__file_li = false;
|
||||
console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
|
||||
$slct_trigger = 'load__event_file_obj_li';
|
||||
ae_tmp.show__file_li = true;
|
||||
|
||||
db_events.files.clear();
|
||||
|
||||
events_func.handle_load_ae_obj_li__event_file({
|
||||
api_cfg: $ae_api,
|
||||
for_obj_type: link_to_type,
|
||||
for_obj_id: link_to_id,
|
||||
try_cache: false
|
||||
});
|
||||
|
||||
// ae_tmp.show__file_li = false;
|
||||
// console.log(`$lq__event_file_obj_li:`, $lq__event_file_obj_li);
|
||||
// $slct_trigger = 'load__event_file_obj_li';
|
||||
// ae_tmp.show__file_li = true;
|
||||
}}
|
||||
class="btn btn-sm p-1 m-1 variant-soft-tertiary hover:variant-ghost-warning transition hover:transition-all *:hover:inline"
|
||||
class:hidden={display_mode != 'default' && !$ae_loc.administrator_access}
|
||||
@@ -192,7 +202,7 @@ onMount(() => {
|
||||
</button>
|
||||
<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 *:hover:inline"
|
||||
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}`}
|
||||
>
|
||||
@@ -204,7 +214,7 @@ onMount(() => {
|
||||
<button
|
||||
type="button"
|
||||
use:clipboard={encodeURI(`${$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 *:hover:inline"
|
||||
class="btn btn-sm variant-soft-secondary m-0.5 *:hover:inline"
|
||||
class:hidden={!ae_tmp.show__direct_download}
|
||||
title="Copy the direct download file link to the clipboard."
|
||||
>
|
||||
|
||||
@@ -44,7 +44,7 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
{#if event_file_id_random_li && $lq_kv__event_file_obj_li && $lq_kv__event_file_obj_li?.length > 0 && $lq_kv__event_file_obj_li?.length == event_file_id_random_li?.length}
|
||||
<div class="overflow-auto">
|
||||
<h2 class="h3">
|
||||
<span class="text-md">
|
||||
<span class="text-base">
|
||||
Results:
|
||||
</span>
|
||||
|
||||
@@ -58,16 +58,18 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
{/if}
|
||||
</h2>
|
||||
<table
|
||||
class="table-auto w-full table-striped table-hover"
|
||||
class="table-auto w-full table-striped table-hover text-xs lg:text-sm"
|
||||
>
|
||||
<thead>
|
||||
<thead
|
||||
class=""
|
||||
>
|
||||
<tr>
|
||||
<th class="px-4 py-2">
|
||||
Filename
|
||||
<!-- ({$lq_kv__event_file_obj_li?.length}x) -->
|
||||
</th>
|
||||
<th class="px-4 py-2">
|
||||
Download Link
|
||||
Link
|
||||
</th>
|
||||
<th class="px-4 py-2">Size</th>
|
||||
<th class="px-4 py-2">Uploaded</th>
|
||||
@@ -90,7 +92,8 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody
|
||||
class="">
|
||||
{#each $lq_kv__event_file_obj_li as event_file_obj}
|
||||
<tr
|
||||
class:dim={event_file_obj?.hide}>
|
||||
@@ -112,7 +115,7 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
|
||||
// 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 variant-soft-primary hover:variant-filled-primary min-w-72 lg:min-w-96"
|
||||
class="btn btn-sm variant-soft-primary hover:variant-filled-primary min-w-72"
|
||||
title={`Download this file: ${event_file_obj?.filename} [API] -- SHA256 hash: ${event_file_obj?.hash_sha256.slice(0, 10)}...`}
|
||||
>
|
||||
{#await ae_promises[event_file_obj?.event_file_id_random]}
|
||||
@@ -149,10 +152,10 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
<td class="px-4 py-2">
|
||||
<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 *:hover:inline"
|
||||
class="btn btn-sm variant-soft-secondary m-0.5 *:hover:inline lg:text-xs"
|
||||
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 m-1"></span>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
<div class="hidden">
|
||||
Download
|
||||
</div>
|
||||
@@ -160,17 +163,17 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
<button
|
||||
type="button"
|
||||
use:clipboard={encodeURI(`${$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 *:hover:inline"
|
||||
class="btn btn-sm variant-soft-secondary m-0.5 *:hover:inline lg:text-xs"
|
||||
title="Copy the direct download file link to the clipboard."
|
||||
>
|
||||
<span class="fas fa-copy m-1"></span>
|
||||
<span class="fas fa-copy mx-1"></span>
|
||||
<div class="hidden">
|
||||
Copy Link
|
||||
</div>
|
||||
</button>
|
||||
</td>
|
||||
<td class="px-4 py-2">{ae_util.format_bytes(event_file_obj?.file_size)}</td>
|
||||
<td class="px-4 py-2 text-sm">
|
||||
<td class="px-4 py-2">
|
||||
<div>
|
||||
<span>
|
||||
{ae_util.iso_datetime_formatter(event_file_obj?.created_on, 'dddd')}
|
||||
@@ -184,7 +187,7 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
</span>
|
||||
</td>
|
||||
{#if show_location_fields}
|
||||
<td class="px-4 py-2">
|
||||
<td class="px-4 py-2 lg:text-xs">
|
||||
{#if event_file_obj?.event_location_id_random}
|
||||
<!-- <span class="fas fa-map-marker-alt"></span> -->
|
||||
{event_file_obj?.event_location_name}
|
||||
@@ -195,26 +198,26 @@ let lq_kv__event_file_obj_li = liveQuery(
|
||||
{/if}
|
||||
|
||||
{#if show_session_fields}
|
||||
<td class="px-4 py-2">
|
||||
<td class="px-4 py-2 lg:text-xs">
|
||||
<span class="fas fa-chalkboard-teacher"></span>
|
||||
<a
|
||||
href="/events_pres_mgmt/session/{event_file_obj?.event_session_id_random}"
|
||||
class="text-blue-500 underline hover:text-blue-800"
|
||||
>
|
||||
{event_file_obj?.event_session_name}
|
||||
{event_file_obj?.event_session_name}
|
||||
</a>
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm">{ae_util.iso_datetime_formatter(event_file_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
|
||||
<td class="px-4 py-2">{ae_util.iso_datetime_formatter(event_file_obj?.event_session_start_datetime, 'datetime_us_no_seconds')}</td>
|
||||
{/if}
|
||||
{#if show_presentation_fields}
|
||||
<td class="px-4 py-2">
|
||||
<td class="px-4 py-2 lg:text-xs">
|
||||
{#if event_file_obj?.event_presentation_id_random}
|
||||
{event_file_obj?.event_presentation_name}
|
||||
{:else}
|
||||
{@html ae_snip.html__not_set}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="px-4 py-2 text-sm">
|
||||
<td class="px-4 py-2">
|
||||
{#if event_file_obj?.event_presentation_id_random}
|
||||
{ae_util.iso_datetime_formatter(event_file_obj?.event_presentation_start_datetime, 'time_us_short')}
|
||||
{:else}
|
||||
|
||||
@@ -53,7 +53,7 @@ let lq_kv__event_presenter_obj_li = liveQuery(
|
||||
{/if}
|
||||
</h2>
|
||||
<table
|
||||
class="table-auto w-full table-striped table-hover"
|
||||
class="table-auto w-full table-striped table-hover text-xs lg:text-sm"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -75,7 +75,8 @@ let lq_kv__event_presenter_obj_li = liveQuery(
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody
|
||||
class="">
|
||||
{#each $lq_kv__event_presenter_obj_li as event_presenter_obj}
|
||||
<tr
|
||||
class:dim={event_presenter_obj?.hide}>
|
||||
@@ -101,7 +102,7 @@ let lq_kv__event_presenter_obj_li = liveQuery(
|
||||
<td class="px-4 py-2">{event_presenter_obj?.file_count ?? '0'}</td>
|
||||
|
||||
{#if show_session_fields}
|
||||
<td class="px-4 py-2">
|
||||
<td class="px-4 py-2 lg:text-xs">
|
||||
<span class="fas fa-chalkboard-teacher"></span>
|
||||
<a
|
||||
href="/events_pres_mgmt/session/{event_presenter_obj?.event_session_id_random}"
|
||||
@@ -114,8 +115,8 @@ let lq_kv__event_presenter_obj_li = liveQuery(
|
||||
{/if}
|
||||
|
||||
{#if show_presentation_fields}
|
||||
<td class="px-4 py-2">{event_presenter_obj?.event_presentation_name}</td>
|
||||
<td class="px-4 py-2 text-sm">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_presentation_start_datetime, 'time_us_short')}</td>
|
||||
<td class="px-4 py-2 lg:text-xs">{event_presenter_obj?.event_presentation_name}</td>
|
||||
<td class="px-4 py-2 lg:text-xs">{ae_util.iso_datetime_formatter(event_presenter_obj?.event_presentation_start_datetime, 'time_us_short')}</td>
|
||||
{/if}
|
||||
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user