A lot of cosmetic clean up and some code clean up. Also new util functions from old Svelte NPM library.
This commit is contained in:
@@ -290,10 +290,12 @@ $: if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id)
|
||||
<td>
|
||||
<a
|
||||
href="/events_pres_mgmt/session/{session_obj.event_session_id_random}"
|
||||
class="btn btn-md variant-ghost-secondary hover:variant-filled-secondary"
|
||||
class="btn btn-md variant-ghost-secondary hover:variant-filled-secondary w-full"
|
||||
>
|
||||
<span class="fas fa-eye mx-1"></span>
|
||||
<span class="grow">
|
||||
<strong>{session_obj.name}</strong>
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -305,14 +305,32 @@ $: if ($slct_trigger == 'load__event_presenter_obj_li') {
|
||||
}
|
||||
|
||||
|
||||
function send_init_confirm_email({to_email, to_name, person_id, person_passcode, presentation_id, presenter_id, presentation_name}) {
|
||||
function send_init_confirm_email(
|
||||
{
|
||||
to_email,
|
||||
to_name,
|
||||
person_id,
|
||||
person_passcode,
|
||||
presentation_id,
|
||||
presenter_id,
|
||||
presentation_name
|
||||
}: {
|
||||
to_email: string,
|
||||
to_name: string,
|
||||
person_id: string,
|
||||
person_passcode: string,
|
||||
presentation_id: string,
|
||||
presenter_id: string,
|
||||
presentation_name: string
|
||||
}
|
||||
) {
|
||||
console.log(`*** send_init_confirm_email() *** to ${to_email}.`);
|
||||
|
||||
// to_email = 'test+agree@oneskyit.com';
|
||||
|
||||
let sign_in_url = encodeURI(`${data.url.origin}/events_pres_mgmt/session/${$events_slct.event_session_id}?person_id=${person_id}&person_pass=${person_passcode}&presentation_id=${presentation_id}&presenter_id=${presenter_id}`)
|
||||
|
||||
let subject = `LCI Congress 2024 - Pres Mgmt Hub Sign In Link for ${$lq__event_session_obj.name} (ID: ${$events_slct.event_session_id})`;
|
||||
let subject = `LCI Congress 2024 - Pres Mgmt Hub Sign In Link for ${$lq__event_session_obj?.name} (ID: ${$events_slct.event_session_id})`;
|
||||
|
||||
let body_html = `
|
||||
<div>${to_name},
|
||||
@@ -322,8 +340,8 @@ function send_init_confirm_email({to_email, to_name, person_id, person_passcode,
|
||||
<div>
|
||||
<strong>26th Annual Lean Construction Congress (2024)</strong>:<br>
|
||||
<p>
|
||||
Session Name: ${$lq__event_session_obj.name}<br>
|
||||
Session ID: ${$lq__event_session_obj.event_session_id_random}<br>
|
||||
Session Name: ${$lq__event_session_obj?.name}<br>
|
||||
Session ID: ${$lq__event_session_obj?.event_session_id_random}<br>
|
||||
Presentation Name: ${presentation_name}<br>
|
||||
Presentation ID: ${presentation_id}
|
||||
</p>
|
||||
@@ -342,20 +360,19 @@ function send_init_confirm_email({to_email, to_name, person_id, person_passcode,
|
||||
}
|
||||
|
||||
|
||||
function send_sign_in_poc_email({
|
||||
function send_sign_in_poc_email(
|
||||
{
|
||||
to_email,
|
||||
to_name,
|
||||
person_id,
|
||||
person_passcode,
|
||||
session_id,
|
||||
session_name
|
||||
}: {
|
||||
to_email: string,
|
||||
to_name: string,
|
||||
person_id: string,
|
||||
person_passcode: string,
|
||||
session_id: string,
|
||||
session_name: string
|
||||
}
|
||||
) {
|
||||
console.log(`*** send_sign_in_poc_email() *** to ${to_email}.`);
|
||||
@@ -400,7 +417,7 @@ function send_sign_in_poc_email({
|
||||
|
||||
{#if $events_slct.event_session_id && $lq__event_session_obj}
|
||||
|
||||
<h2 class="h2 text-center">{$lq__event_session_obj.name}</h2>
|
||||
<h2 class="h2 text-center">{$lq__event_session_obj?.name ?? '-- not set --'}</h2>
|
||||
|
||||
<!-- Information about the session -->
|
||||
<section>
|
||||
@@ -455,7 +472,6 @@ function send_sign_in_poc_email({
|
||||
person_id: $lq__event_session_obj.poc_person_id_random,
|
||||
person_passcode: $lq__event_session_obj.poc_person_passcode,
|
||||
session_id: $lq__event_session_obj.event_session_id_random,
|
||||
session_name: $lq__event_session_obj.name,
|
||||
}
|
||||
);
|
||||
}}
|
||||
@@ -543,22 +559,28 @@ function send_sign_in_poc_email({
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.trusted_access || $events_loc.auth__kv.session[$events_slct.event_session_id] || ($events_loc.auth__kv.presenter[$events_slct.event_presenter_id] && $lq__event_presenter_obj?.agree)}
|
||||
|
||||
<div class="min-w-max flex flex-col gap-1">
|
||||
<a
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary"
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary flex flex-row items-center justify-between min-w-full"
|
||||
href="https://static.oneskyit.com/c/LCI/files/LCI_Congress_Template_2024.pptx"
|
||||
>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
<span class="text-center grow">
|
||||
Download
|
||||
LCI Congress Template 2024 (PowerPoint)
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary"
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary flex flex-row items-center justify-between min-w-full"
|
||||
href="https://static.oneskyit.com/c/LCI/files/LCI_Speaker_and_Champion_Congress_Task_List_2024.xlsx"
|
||||
>
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
Download
|
||||
LCI Speaker and Champion Congress Task List (Excel)
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{:else}
|
||||
<span class="text-lg text-red-500 font-bold text-center p-1 m-1 border border-red-200 rounded-md bg-red-100 space-y-2">
|
||||
<p><strong>Read and Consent Agreement?</strong></p>
|
||||
@@ -784,11 +806,13 @@ function send_sign_in_poc_email({
|
||||
$events_sess.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
}
|
||||
class="btn btn-lg variant-ghost-primary text-lg font-bold min-w-56 hover:variant-filled-primary"
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary font-bold min-w-64"
|
||||
title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.email}"
|
||||
>
|
||||
<span class="fas fa-user mx-1"></span>
|
||||
{event_presenter_obj.full_name}
|
||||
<span class="fas fa-user mx-1"></span>
|
||||
<span class="text-center grow">
|
||||
{event_presenter_obj.full_name}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
|
||||
@@ -947,10 +971,16 @@ function send_sign_in_poc_email({
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
{#each $lq__event_file_obj_li as event_file_obj}
|
||||
{#if (event_file_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random && ($ae_loc.trusted_access || $events_loc.auth__kv.presentation[event_presentation_obj.event_presentation_id_random]))}
|
||||
{#if (
|
||||
event_file_obj.event_presentation_id_random == event_presentation_obj.event_presentation_id_random
|
||||
&& (
|
||||
$ae_loc.trusted_access
|
||||
|| $events_loc.auth__kv.presentation[event_presentation_obj.event_presentation_id_random]
|
||||
|| $events_loc.auth__kv.session[$events_slct.event_session_id] // This is the session ID of the person who signed in.
|
||||
)
|
||||
)}
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-md variant-soft-primary"
|
||||
on:click={() => {
|
||||
// ae_promises[event_file_obj.event_file_id_random]
|
||||
ae_promises[event_file_obj.event_file_id_random] = api.download_hosted_file({
|
||||
@@ -964,15 +994,13 @@ function send_sign_in_poc_email({
|
||||
|
||||
// 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-md variant-soft-primary hover:variant-filled-primary min-w-96"
|
||||
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]}
|
||||
|
||||
<span class="mx-1">
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
<span class="">
|
||||
Downloading
|
||||
|
||||
{#if $ae_sess.download[`/hosted_file/${event_file_obj.hosted_file_id_random}/download`]}
|
||||
{$ae_sess.download[`/hosted_file/${event_file_obj.hosted_file_id_random}/download`].percent_completed}%
|
||||
{/if}
|
||||
@@ -980,10 +1008,14 @@ function send_sign_in_poc_email({
|
||||
</span>
|
||||
{:then}
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
<span class="text-sm">
|
||||
Download:
|
||||
</span>
|
||||
{/await}
|
||||
|
||||
{event_file_obj.filename.slice(0, 20)}...{event_file_obj.extension}
|
||||
<span class="grow">
|
||||
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: 25})}
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { liveQuery } from "dexie";
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils';
|
||||
import { ae_util, shorten_string } from '$lib/ae_utils';
|
||||
import { api } from '$lib/api';
|
||||
import Element_data_store from '$lib/element_data_store.svelte';
|
||||
import Element_ae_crud from '$lib/element_ae_crud.svelte';
|
||||
@@ -435,7 +435,6 @@ WARNING: The file upload and management is a work in progress. You can upload an
|
||||
>{file_obj.filename}</a> -->
|
||||
|
||||
<button
|
||||
class="btn btn-md variant-soft-primary min-w-96"
|
||||
on:click={() => {
|
||||
// ae_promises[event_file_obj.event_file_id_random]
|
||||
ae_promises[event_file_obj.event_file_id_random] = api.download_hosted_file({
|
||||
@@ -449,15 +448,13 @@ WARNING: The file upload and management is a work in progress. You can upload an
|
||||
|
||||
// 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-md variant-ghost-primary hover:variant-filled-primary min-w-96"
|
||||
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]}
|
||||
|
||||
<span class="mx-1">
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
|
||||
<span class="fas fa-spinner fa-spin mx-1"></span>
|
||||
<span class="">
|
||||
Downloading
|
||||
|
||||
{#if $ae_sess.download[`/hosted_file/${event_file_obj.hosted_file_id_random}/download`]}
|
||||
{$ae_sess.download[`/hosted_file/${event_file_obj.hosted_file_id_random}/download`].percent_completed}%
|
||||
{/if}
|
||||
@@ -465,10 +462,14 @@ WARNING: The file upload and management is a work in progress. You can upload an
|
||||
</span>
|
||||
{:then}
|
||||
<span class="fas fa-download mx-1"></span>
|
||||
<span class="text-sm">
|
||||
Download:
|
||||
</span>
|
||||
{/await}
|
||||
|
||||
{event_file_obj.filename.slice(0, 20)}...{event_file_obj.extension}
|
||||
<span class="grow">
|
||||
{ae_util.shorten_filename({filename: event_file_obj.filename, max_length: 25})}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button type="button"
|
||||
|
||||
Reference in New Issue
Block a user