Clean up of auth logic
This commit is contained in:
@@ -204,7 +204,7 @@ $: if ($events_trigger == 'load__event_session_obj_li' && $events_slct.event_id)
|
||||
<h2>{$event_obj.name}</h2>
|
||||
{/if}
|
||||
|
||||
<div class="variant-ghost-success my-2 p-2 flex flex-row items-center">
|
||||
<div class="variant-ghost-success my-2 p-2 rounded-md flex flex-row items-center">
|
||||
|
||||
<form
|
||||
on:submit|preventDefault={() => {
|
||||
|
||||
@@ -36,14 +36,15 @@ $events_slct.event_obj = ae_acct.slct.event_obj;
|
||||
$events_slct.event_session_id = ae_acct.slct.event_session_id;
|
||||
$events_slct.event_session_obj = ae_acct.slct.event_session_obj;
|
||||
$events_slct.event_presentation_obj_li = ae_acct.slct.event_presentation_obj_li;
|
||||
// $events_slct.event_file_obj_li = ae_acct.slct.event_file_obj_li;
|
||||
|
||||
if (!$events_loc.auth__person) {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
id: null,
|
||||
email: null,
|
||||
full_name: null,
|
||||
entered_key: null,
|
||||
entered_passcode: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -83,14 +84,22 @@ let event_obj = liveQuery(
|
||||
let event_obj_v2 = db_events.events.get($events_slct.event_id);
|
||||
|
||||
|
||||
let event_session_obj = liveQuery(
|
||||
let lq__event_session_obj = liveQuery(
|
||||
() => db_events.sessions.get($events_slct.event_session_id)
|
||||
);
|
||||
|
||||
let event_presentation_obj_li = liveQuery(
|
||||
let lq__event_presentation_obj_li = liveQuery(
|
||||
() => db_events.presentations.where('event_session_id_random').equals($events_slct.event_session_id_random).toArray()
|
||||
);
|
||||
|
||||
let lq__event_presentation_obj = liveQuery(
|
||||
() => db_events.presentations.get($events_slct.event_presentation_id)
|
||||
);
|
||||
|
||||
let lq__event_presenter_obj = liveQuery(
|
||||
() => db_events.presenters.get($events_slct.event_presenter_id)
|
||||
);
|
||||
|
||||
// Load the Event Obj with ID based on the slug param.
|
||||
// $events_slct.event_id = param_slug_event_id;
|
||||
// console.log('Selected Event ID:', $events_slct.event_id);
|
||||
@@ -127,22 +136,57 @@ onMount(() => {
|
||||
|
||||
// console.log(`ae_events_pres_mgmt presenter [slug] +page.svelte data:`, data);
|
||||
|
||||
if (!$events_slct.event_id) {
|
||||
console.log(`No ID! Nothing to show. Try setting the ID again.`);
|
||||
$events_slct.event_id = $events_slct.event_id;
|
||||
}
|
||||
if (!$events_slct.event_session_id) {
|
||||
console.log(`No Session ID! Nothing to show. Try setting the Session ID again.`);
|
||||
$events_slct.event_session_id = $events_slct.event_session_id;
|
||||
}
|
||||
// if (!$events_slct.event_id) {
|
||||
// console.log(`No ID! Nothing to show. Try setting the ID again.`);
|
||||
// $events_slct.event_id = $events_slct.event_id;
|
||||
// }
|
||||
// if (!$events_slct.event_session_id) {
|
||||
// console.log(`No Session ID! Nothing to show. Try setting the Session ID again.`);
|
||||
// $events_slct.event_session_id = $events_slct.event_session_id;
|
||||
// }
|
||||
|
||||
let url_person_id = data.url.searchParams.get('person_id');
|
||||
let url_person_pass = data.url.searchParams.get('person_pass');
|
||||
if (url_person_pass) {
|
||||
console.log(`ae_events_pres_mgmt session [slug] +page.svelte: event_session_id=${$events_slct.session_id}; person_id=${url_person_id}; person_pass=${url_person_pass}`);
|
||||
let url_presentation_id = data.url.searchParams.get('presentation_id');
|
||||
let url_presenter_id = data.url.searchParams.get('presenter_id');
|
||||
|
||||
// This should be turned into a function to correctly authenticate the person and allow them access to their presentations and presenter details.
|
||||
if (url_person_pass) {
|
||||
console.log(`ae_events_pres_mgmt session [slug] +page.svelte: event_session_id=${$events_slct.session_id}; person_id=${url_person_id}; person_pass=${url_person_pass}; presentation_id=${url_presentation_id}; presenter_id=${url_presenter_id}`);
|
||||
|
||||
// Using temporary session values first.
|
||||
$events_sess.auth__entered_key = url_person_id;
|
||||
$events_sess.auth__entered_passcode = url_person_pass;
|
||||
|
||||
$events_sess.auth__person.id = url_person_id;
|
||||
$events_sess.auth__person.presentation_id = url_presentation_id;
|
||||
$events_sess.auth__person.presenter_id = url_presenter_id;
|
||||
|
||||
$events_sess.auth__kv.person[url_person_id] = true;
|
||||
// $events_sess.auth__kv.session[$events_slct.event_session_id] = true;
|
||||
$events_sess.auth__kv.presentation[url_presentation_id] = true;
|
||||
$events_sess.auth__kv.presenter[url_presenter_id] = true;
|
||||
|
||||
// We need to set the selected presentation and presenter objects based on the respective IDs.
|
||||
if (url_presentation_id && url_presenter_id) {
|
||||
$events_slct.event_presentation_id = url_presentation_id;
|
||||
$events_slct.event_presenter_id = url_presenter_id;
|
||||
}
|
||||
|
||||
// // We need to load the presentation and presenter objects based on the IDs.
|
||||
// if ($events_slct.event_presentation_obj_li && $events_slct.event_presentation_obj_li.length > 0) {
|
||||
// let event_presentation_obj = $events_slct.event_presentation_obj_li.find((obj) => obj.event_presentation_id_random == url_presentation_id);
|
||||
// $events_slct.presentation_obj = event_presentation_obj;
|
||||
// if (event_presentation_obj.event_presenter_li && event_presentation_obj.event_presenter_li.length > 0) {
|
||||
// let event_presenter_obj = event_presentation_obj.event_presenter_li.find((obj) => obj.event_presenter_id_random == url_presenter_id);
|
||||
// $events_slct.presenter_obj = event_presenter_obj;
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// // events_func.handle_load_ae_obj_id__presentation({api_cfg: $ae_api, presentation_id: url_presentation_id});
|
||||
// }
|
||||
|
||||
$events_sess.entered_key = url_person_id;
|
||||
$events_sess.entered_passcode = url_person_pass;
|
||||
|
||||
// console.log('Remove the passcode from the URL.');
|
||||
// data.url.searchParams.delete('person_id');
|
||||
@@ -167,9 +211,9 @@ onMount(() => {
|
||||
>
|
||||
|
||||
|
||||
{#if $events_slct.event_session_id && $event_session_obj}
|
||||
{#if $events_slct.event_session_id && $lq__event_session_obj}
|
||||
|
||||
<h2 class="h2 text-center">{$event_session_obj.name}</h2>
|
||||
<h2 class="h2 text-center">{$lq__event_session_obj.name}</h2>
|
||||
|
||||
<!-- Information about the session -->
|
||||
<section>
|
||||
@@ -179,23 +223,23 @@ onMount(() => {
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
<li>
|
||||
<strong class="text-sm">Name/Title:</strong> {$event_session_obj.name}
|
||||
<strong class="text-sm">Name/Title:</strong> {$lq__event_session_obj.name}
|
||||
<span class="text-sm text-gray-500 bg-yellow-100 p-1 rounded-md border border-yellow-200"
|
||||
title="Session code {$event_session_obj.code}"
|
||||
title="Session code {$lq__event_session_obj.code}"
|
||||
>
|
||||
<span class="fas fa-barcode"></span>
|
||||
{$event_session_obj.code}
|
||||
{$lq__event_session_obj.code}
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<strong class="text-sm">Date time:</strong> {ae_util.iso_datetime_formatter($event_session_obj.start_datetime, 'datetime_long')} - {ae_util.iso_datetime_formatter($event_session_obj.end_datetime, 'datetime_long')}
|
||||
<strong class="text-sm">Date time:</strong> {ae_util.iso_datetime_formatter($lq__event_session_obj.start_datetime, 'datetime_long')} - {ae_util.iso_datetime_formatter($lq__event_session_obj.end_datetime, 'datetime_long')}
|
||||
</li>
|
||||
<li>
|
||||
<strong class="text-sm">Location/Room:</strong> {$event_session_obj.event_location_name ? $event_session_obj.event_location_name : '-- not set --'}
|
||||
<strong class="text-sm">Location/Room:</strong> {$lq__event_session_obj.event_location_name ? $lq__event_session_obj.event_location_name : '-- not set --'}
|
||||
</li>
|
||||
{#if $ae_loc.trusted_access}
|
||||
<li>
|
||||
<strong class="text-sm">Session passcode:</strong> {$event_session_obj.passcode ? $event_session_obj.passcode : '-- not set --'}
|
||||
<strong class="text-sm">Session passcode:</strong> {$lq__event_session_obj.passcode ? $lq__event_session_obj.passcode : '-- not set --'}
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
@@ -225,7 +269,7 @@ onMount(() => {
|
||||
<pre
|
||||
class="whitespace-pre-wrap p-2 bg-gray-100 rounded-md"
|
||||
class:hidden={!$events_loc.pres_mgmt.show_content__session_description}
|
||||
>{$event_session_obj.description}</pre>
|
||||
>{$lq__event_session_obj.description}</pre>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -238,13 +282,13 @@ onMount(() => {
|
||||
cols="30"
|
||||
rows="4"
|
||||
disabled
|
||||
>{$event_session_obj.description}</textarea>
|
||||
>{$lq__event_session_obj.description}</textarea>
|
||||
</label> -->
|
||||
|
||||
<div class="m-1 flex flex-col flex-wrap gap-1 items-center">
|
||||
{#if $ae_loc.trusted_access || $events_loc.auth__kv.session[$events_slct.event_session_id]}
|
||||
|
||||
{#if $events_slct.presenter_obj.agree}
|
||||
{#if $ae_loc.trusted_access || ($events_loc.auth__kv.presenter[$events_slct.event_presenter_id] && $lq__event_presenter_obj?.agree)}
|
||||
<a
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary"
|
||||
href="https://static.oneskyit.com/c/LCI/files/LCI_Congress_Template_2024.pptx"
|
||||
@@ -262,24 +306,26 @@ onMount(() => {
|
||||
LCI Speaker and Champion Congress Task List (Excel)
|
||||
</a>
|
||||
{:else}
|
||||
<span class="text-xl text-red-500 font-bold text-center">
|
||||
<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>
|
||||
<p>
|
||||
Please select your name below to view, read, and consent the agreement.
|
||||
</p>
|
||||
|
||||
<p>Please select your name below to view, read, and consent the agreement.</p>
|
||||
|
||||
<p>You will be able to download the LCI Congress Template 2024 (PowerPoint) and LCI Speaker and Champion Congress Task List (Excel) after you have read and consented to the agreement.</p>
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
{#if $events_loc.auth__person?.id}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
on:click={() => {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
id: null,
|
||||
email: null,
|
||||
full_name: null,
|
||||
entered_key: null,
|
||||
entered_passcode: null,
|
||||
};
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
@@ -291,98 +337,110 @@ onMount(() => {
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Sign Out
|
||||
Sign Out (Clear Session)
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{:else}
|
||||
<div class="text-xl text-red-500 font-bold text-center p-1 m-1">
|
||||
<p><strong>Restricted access!</strong></p>
|
||||
<p>
|
||||
Please select your name below to email the access link.
|
||||
The email address associated with your LCI member record will be used.
|
||||
This is not shown below for safety reasons.
|
||||
<!-- This email address must match your LCI member record. -->
|
||||
</p>
|
||||
<div
|
||||
class="text-xl text-red-500 font-bold text-center p-1 m-1 border border-red-200 rounded-md bg-red-100"
|
||||
>
|
||||
<p><strong>Restricted access!</strong></p>
|
||||
<p>
|
||||
Please select your name below to email the access link.
|
||||
The email address associated with your LCI member record will be used.
|
||||
The email address is not shown below for safety reasons.
|
||||
<!-- This email address must match your LCI member record. -->
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
class="border border-gray-200 p-2 rounded-md m-2 text-center space-y-2"
|
||||
>
|
||||
<div
|
||||
class="text-sm text-gray-500"
|
||||
>
|
||||
Use the link that was sent to your email address to sign in or enter your key and passcode to sign in.
|
||||
Use the link that was sent to your email address to sign in or enter your key and passcode to sign in.
|
||||
</div>
|
||||
<div
|
||||
class="text-center"
|
||||
>
|
||||
<div
|
||||
class="border border-gray-200 p-2 rounded-md m-2"
|
||||
>
|
||||
<div>
|
||||
<input
|
||||
type="text"
|
||||
class="input max-w-36"
|
||||
placeholder="Key"
|
||||
value={$events_sess.entered_key ?? ''}
|
||||
on:input={(e) => $events_sess.entered_key = e.target.value}
|
||||
value={$events_sess.auth__entered_key ?? ''}
|
||||
on:input={(e) => $events_sess.auth__entered_key = e.target.value}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
class="input max-w-36"
|
||||
placeholder="Passcode"
|
||||
value={$events_sess.entered_passcode ?? ''}
|
||||
on:input={(e) => $events_sess.entered_passcode = e.target.value}
|
||||
value={$events_sess.auth__entered_passcode ?? ''}
|
||||
on:input={(e) => $events_sess.auth__entered_passcode = e.target.value}
|
||||
>
|
||||
<button
|
||||
class="btn btn-md variant-ghost-primary"
|
||||
on:click={() => {
|
||||
console.log('Sign in');
|
||||
$events_loc.auth__person.id = $events_sess.entered_key; // person_id
|
||||
$events_loc.auth__person.entered_key = $events_sess.entered_key; // also person_id in this case
|
||||
console.log('Sign in with URL values');
|
||||
|
||||
// This needs to be moved to a function!
|
||||
|
||||
$events_loc.auth__person.id = $events_sess.auth__entered_key; // person_id
|
||||
$events_loc.auth__person.entered_key = $events_sess.auth__entered_key; // also person_id in this case
|
||||
$events_loc.auth__person.email = 'test@example.com';
|
||||
$events_loc.auth__person.full_name = 'Test Person';
|
||||
|
||||
$events_loc.auth__kv.person[$events_sess.entered_key] = true;
|
||||
$events_loc.auth__kv.session[$events_slct.event_session_id] = true;
|
||||
$events_loc.auth__kv.presentation[$events_sess.auth__person.presentation_id] = true;
|
||||
$events_loc.auth__kv.presenter[$events_sess.auth__person.presenter_id] = true;
|
||||
|
||||
// Setting again here... just because for now.
|
||||
$events_slct.event_presentation_id = $events_sess.auth__person.presentation_id;
|
||||
$events_slct.event_presenter_id = $events_sess.auth__person.presenter_id;
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Sign In
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
on:click={() => {
|
||||
$events_loc.auth__person = {
|
||||
id: '',
|
||||
email: '',
|
||||
full_name: '',
|
||||
entered_key: '',
|
||||
entered_passcode: '',
|
||||
};
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
presentation: {},
|
||||
presenter: {},
|
||||
person: {},
|
||||
};
|
||||
alert('You have been signed out.');
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Sign Out
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="text-sm text-gray-500"
|
||||
>
|
||||
For: presentation: {$events_sess.auth__person.presentation_id} presenter: {$events_sess.auth__person.presenter_id}
|
||||
<br>
|
||||
|
||||
{$lq__event_presentation_obj?.name ? `Name: "${$lq__event_presentation_obj.name}"` : '-- not set --'}
|
||||
</div>
|
||||
|
||||
|
||||
{#if $events_loc.auth__person?.id}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-warning"
|
||||
on:click={() => {
|
||||
$events_loc.auth__person = {
|
||||
id: null,
|
||||
email: null,
|
||||
full_name: null,
|
||||
entered_key: null,
|
||||
entered_passcode: null,
|
||||
};
|
||||
$events_loc.auth__kv = {
|
||||
session: {},
|
||||
presentation: {},
|
||||
presenter: {},
|
||||
person: {},
|
||||
};
|
||||
alert('You have been signed out.');
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-times mx-1"></span>
|
||||
Sign Out
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- <button
|
||||
class="btn btn-md variant-soft-primary"
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Email Access Link
|
||||
</button> -->
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -454,6 +512,7 @@ onMount(() => {
|
||||
class:hidden={$events_loc.pres_mgmt.show_content__presentation_description !== event_presentation_obj.event_presentation_id_random}
|
||||
>{event_presentation_obj.description}</pre>
|
||||
|
||||
<!-- Show presenters for this presentation -->
|
||||
{#await event_presentation_obj.event_presenter_li}
|
||||
<p>Loading...</p>
|
||||
{:then event_presenter_li}
|
||||
@@ -464,34 +523,55 @@ onMount(() => {
|
||||
>
|
||||
{#each event_presenter_li as event_presenter_obj}
|
||||
<li>
|
||||
{#if event_presenter_obj.agree}
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-md variant-outline-success"
|
||||
disabled={!$events_loc.auth__kv.person[event_presenter_obj.person_id_random]}
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View presenter details');
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]}
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View presenter details');
|
||||
|
||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
$events_slct.presentation_obj = event_presentation_obj;
|
||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
$events_slct.presentation_obj = event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||
$events_slct.presenter_obj = event_presenter_obj;
|
||||
$events_slct.event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||
$events_slct.presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_loc.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
$events_loc.pres_mgmt.show_content__presenter_start = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
title="Agreed to terms and conditions"
|
||||
>
|
||||
<span class="fas fa-check text-green-500 px-1" title="Agreed to terms and conditions"></span>
|
||||
Agreed
|
||||
</button>
|
||||
{:else}
|
||||
}
|
||||
class="btn btn-lg variant-ghost-primary text-lg font-bold min-w-56"
|
||||
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}
|
||||
</button>
|
||||
|
||||
|
||||
|
||||
{#if $ae_loc.trusted_access || !$events_loc.auth__person.id }
|
||||
<button
|
||||
class="btn btn-md variant-ghost-primary hover:variant-filled-primary"
|
||||
on:click={() => {
|
||||
console.log('Email the access link');
|
||||
alert(`NOT ENABLED: Emails link to the presenter (${event_presenter_obj.email}):\n${data.url.origin}/events_pres_mgmt/session/${$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}`);
|
||||
// send_email({
|
||||
// to: event_presenter_obj.email,
|
||||
// subject: `Access link for ${$lq__event_session_obj.name}`,
|
||||
// body: `Hello ${event_presenter_obj.full_name},\n\nHere is the access link for the session: ${data.url.origin}/events_pres_mgmt/session/{$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}\n\nThank you,\n\nThe LCI Team`,
|
||||
// });
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Email Access Link
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
{#if event_presenter_obj.agree}
|
||||
<!-- {#if $ae_loc.trusted_access || $events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]} -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-md variant-outline-warning"
|
||||
disabled={!$events_loc.auth__kv.person[event_presenter_obj.person_id_random]}
|
||||
disabled={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]}
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View terms and conditions');
|
||||
@@ -504,6 +584,29 @@ onMount(() => {
|
||||
$events_loc.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
}
|
||||
class="btn btn-md variant-ghost-success"
|
||||
title="Agreed to terms and conditions"
|
||||
>
|
||||
<span class="fas fa-check text-green-500 px-1" title="Agreed to terms and conditions"></span>
|
||||
Agreed
|
||||
</button>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
disabled={!$ae_loc.trusted_access && !$events_loc.auth__kv.presenter[event_presenter_obj.event_presenter_id_random]}
|
||||
on:click={
|
||||
() => {
|
||||
console.log('View terms and conditions');
|
||||
$events_slct.event_presentation_id = event_presentation_obj.event_presentation_id_random;
|
||||
$events_slct.presentation_obj = event_presentation_obj;
|
||||
|
||||
$events_slct.event_presenter_id = event_presenter_obj.event_presenter_id_random;
|
||||
$events_slct.presenter_obj = event_presenter_obj;
|
||||
|
||||
$events_loc.pres_mgmt.show_content__agree_text = event_presenter_obj.event_presenter_id_random;
|
||||
}
|
||||
}
|
||||
class="btn btn-md variant-ghost-warning"
|
||||
title="View terms and conditions"
|
||||
>
|
||||
<span class="fas fa-times bg-red-500 text-white px-1 mx-1" title="Not agreed to terms and conditions"></span>
|
||||
@@ -511,14 +614,7 @@ onMount(() => {
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<!-- {event_presenter_obj.person_id_random} -->
|
||||
|
||||
<span
|
||||
title="Person ID: {event_presenter_obj.person_id_random}; Email: {event_presenter_obj.email}"
|
||||
>
|
||||
<span class="fas fa-user"></span>
|
||||
{event_presenter_obj.full_name}
|
||||
</span>
|
||||
|
||||
{#if $ae_loc.trusted_access && event_presenter_obj.email}
|
||||
<span class="fas fa-envelope"></span>
|
||||
@@ -549,34 +645,23 @@ onMount(() => {
|
||||
</span>
|
||||
{/if}
|
||||
{:else}
|
||||
<button
|
||||
class="btn btn-sm variant-soft-primary"
|
||||
on:click={() => {
|
||||
console.log('Email the access link');
|
||||
alert(`NOT ENABLED: Emails link to the presenter (${event_presenter_obj.email}):\n${data.url.origin}/events_pres_mgmt/session/${$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}`);
|
||||
// send_email({
|
||||
// to: event_presenter_obj.email,
|
||||
// subject: `Access link for ${$event_session_obj.name}`,
|
||||
// body: `Hello ${event_presenter_obj.full_name},\n\nHere is the access link for the session: ${data.url.origin}/events_pres_mgmt/session/{$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}\n\nThank you,\n\nThe LCI Team`,
|
||||
// });
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-sign-in-alt mx-1"></span>
|
||||
Email Access Link
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{#if $ae_loc.trusted_access}
|
||||
<!-- A button to copy the access link to the clipboard. -->
|
||||
<!-- Example: /events_pres_mgmt/session/Wh8UnJlbIA0?person_id=fV1dl_IJ0yY&person_pass=abc123 -->
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm variant-soft-primary"
|
||||
|
||||
use:clipboard={encodeURI(`${data.url.origin}/events_pres_mgmt/session/${$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}`)}
|
||||
use:clipboard={encodeURI(`${data.url.origin}/events_pres_mgmt/session/${$events_slct.event_session_id}?person_id=${event_presenter_obj.person_id_random}&person_pass=${event_presenter_obj.person_passcode}&presentation_id=${event_presentation_obj.event_presentation_id_random}&presenter_id=${event_presenter_obj.event_presenter_id_random}`)}
|
||||
>
|
||||
<span class="fas fa-copy mx-1"></span>
|
||||
Copy Access Link
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<!-- on:click={() => {
|
||||
let person_id = event_presenter_obj.person_id_random;
|
||||
@@ -596,6 +681,30 @@ onMount(() => {
|
||||
<p>Error: {error.message}</p>
|
||||
{/await}
|
||||
|
||||
<!-- Show files list for this presentation -->
|
||||
{#await event_presentation_obj.event_file_li}
|
||||
<p>Loading...</p>
|
||||
{:then event_file_li}
|
||||
{#if event_file_li}
|
||||
<strong class="text-sm">Files:</strong>
|
||||
<ul
|
||||
class="space-y-2 px-4"
|
||||
>
|
||||
{#each event_file_li as file_obj}
|
||||
<li>
|
||||
<span class="fas fa-file"></span>
|
||||
<a
|
||||
href={file_obj.url}
|
||||
class="text-blue-500"
|
||||
>{file_obj.name}</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
{:catch error}
|
||||
<p>Error: {error.message}</p>
|
||||
{/await}
|
||||
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user