Now with QR codes for sessions and presenters!

This commit is contained in:
Scott Idem
2024-07-18 17:15:12 -04:00
parent a6f8f00e9e
commit af17a05022
7 changed files with 234 additions and 9 deletions

View File

@@ -454,7 +454,19 @@ $: if ($slct_trigger == 'load__event_presenter_obj_li') {
// });
// }
$: if ($lq__event_session_obj) {
// Generate a QR code for the object ID.
// ae_promises.generate_qr_code_obj_id = core_func.generate_qr_code({api_cfg: $ae_api, account_id: $slct.account_id, qr_type: 'obj', qr_id: $lq__event_session_obj?.event_session_id_random, obj_type: 'event_session', obj_id: $lq__event_session_obj?.event_session_id_random});
// Generate a QR code for the URL.
let qr_id_url = `${$lq__event_session_obj?.event_session_id_random}_url`;
// URL for this page (be sure to URL encode it):
let url_str = `${$ae_loc.url_origin}/events_pres_mgmt/session/${$lq__event_session_obj.event_session_id_random}`;
url_str = encodeURI(url_str);
ae_promises.generate_qr_code_url = core_func.generate_qr_code({api_cfg: $ae_api, account_id: $slct.account_id, qr_type: 'str', qr_id: qr_id_url, str: url_str});
}
</script>
@@ -540,6 +552,30 @@ $: if ($slct_trigger == 'load__event_presenter_obj_li') {
<!-- Information about the session -->
<section>
{#await ae_promises.generate_qr_code_url}
Generating...
{:then result}
{#if ae_promises.generate_qr_code_url && $ae_loc.trusted_access}
<span class="float-right m-1 p-1 flex flex-col items-center justify-center outline outline-gray-200 *:hover:inline">
<img
class="qr_code qr_type_url h-32 w-32 hover:h-48 hover:w-48"
style=""
src={result}
alt="URL QR code"
/>
<span>
<span class="fas fa-link"></span>
<span>Session URL</span>
</span>
<div class="hidden">
This QR is a link back to this page.
</div>
</span>
{/if}
{/await}
<ul
class="space-y-2 px-4"
>