Just saving my work so far.
This commit is contained in:
@@ -21,7 +21,7 @@ import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_id
|
|||||||
import { db_events } from "$lib/ae_events/db_events";
|
import { db_events } from "$lib/ae_events/db_events";
|
||||||
import { events_func } from '$lib/ae_events_functions';
|
import { events_func } from '$lib/ae_events_functions';
|
||||||
|
|
||||||
// import Event_obj_id_edit from '.././ae_idaa_comp__event_obj_id_edit.svelte';
|
import Event_obj_id_edit from '.././ae_idaa_comp__event_obj_id_edit.svelte';
|
||||||
import Event_obj_id_view from '.././ae_idaa_comp__event_obj_id_view.svelte';
|
import Event_obj_id_view from '.././ae_idaa_comp__event_obj_id_view.svelte';
|
||||||
|
|
||||||
// *** Quickly pull out data from parent(s)
|
// *** Quickly pull out data from parent(s)
|
||||||
@@ -30,6 +30,7 @@ if (log_lvl) {
|
|||||||
console.log(`ae_acct = `, ae_acct);
|
console.log(`ae_acct = `, ae_acct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$idaa_sess.recovery_meetings.edit__event_id = null;
|
||||||
$idaa_slct.event_id = ae_acct.slct.event_id;
|
$idaa_slct.event_id = ae_acct.slct.event_id;
|
||||||
// $idaa_slct.event_obj = ae_acct.slct.event_obj;
|
// $idaa_slct.event_obj = ae_acct.slct.event_obj;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ let lq__event_obj = $derived(liveQuery(async () => {
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`lq__event_obj: event_id = ${$idaa_slct?.event_id}`);
|
console.log(`lq__event_obj: event_id = ${$idaa_slct?.event_id}`);
|
||||||
}
|
}
|
||||||
let results = await db_events.event
|
let results = await db_events.events
|
||||||
.get($idaa_slct?.event_id ?? ''); // null or undefined does not reset things like '' does
|
.get($idaa_slct?.event_id ?? ''); // null or undefined does not reset things like '' does
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
@@ -61,16 +62,69 @@ if (browser) {
|
|||||||
</title>
|
</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<a href="/idaa/recovery_meetings" class="novi_btn btn btn-secondary btn-sm
|
<h2 class="ae_title event__title text-2xl font-bold">
|
||||||
preset-tonal-tertiary border border-tertiary-500
|
<!-- <span class="ae_icon fas fa-calendar-alt"></span> -->
|
||||||
hover:preset-filled-tertiary-500
|
<span class="ae_icon fas fa-calendar-day"></span>
|
||||||
transition
|
{$lq__event_obj?.name ? $lq__event_obj?.name : 'Recovery Meeting'}
|
||||||
">
|
</h2>
|
||||||
<!-- <span class="fas fa-arrow-left m-1"></span> Back to Meetings -->
|
|
||||||
<span class="fas fa-times m-1"></span> View Other Meetings
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flex flex-row gap-2 items-center justify-between mb-4"
|
||||||
|
>
|
||||||
|
|
||||||
|
<a href="/idaa/recovery_meetings" class="novi_btn btn btn-secondary btn-sm
|
||||||
|
preset-tonal-tertiary border border-tertiary-500
|
||||||
|
hover:preset-filled-tertiary-500
|
||||||
|
transition
|
||||||
|
">
|
||||||
|
<span class="fas fa-arrow-left m-1"></span> Back to Meeting List
|
||||||
|
<!-- <span class="fas fa-times m-1"></span> View Other Meetings -->
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- View (default)/Edit event_id toggle -->
|
||||||
|
{#if $idaa_sess.recovery_meetings.edit__event_id}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="novi_btn btn btn-warning btn-sm preset-tonal-tertiary border border-tertiary-500
|
||||||
|
hover:preset-filled-tertiary-500 transition"
|
||||||
|
onclick={() => {
|
||||||
|
$idaa_sess.recovery_meetings.edit__event_id = false;
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Toggle edit__event_id: ${$idaa_sess.recovery_meetings.edit__event_id}`);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
title="View this recovery meeting"
|
||||||
|
>
|
||||||
|
View Meeting?
|
||||||
|
</button>
|
||||||
|
{:else}
|
||||||
|
<!-- This checks if the currently logged in Novi user has a matching UUID or email address. -->
|
||||||
|
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || idaa_event_obj?.external_person_id === $idaa_loc.novi_uuid || idaa_event_obj?.contact_li_json[0].email === $idaa_loc.novi_email}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="novi_btn btn btn-warning btn-sm preset-tonal-warning border border-warning-500
|
||||||
|
hover:preset-filled-warning-500 transition"
|
||||||
|
onclick={() => {
|
||||||
|
$idaa_sess.recovery_meetings.edit__event_id = $idaa_slct.event_id;
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Toggle edit__event_id: ${$idaa_sess.recovery_meetings.edit__event_id}`);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
title="Edit this recovery meeting"
|
||||||
|
>
|
||||||
|
<span class="fas fa-edit m-1"></span>
|
||||||
|
Edit Meeting?
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if $idaa_sess.recovery_meetings.edit__event_id}
|
||||||
|
<Event_obj_id_edit
|
||||||
|
lq__event_obj={lq__event_obj}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
<Event_obj_id_view
|
<Event_obj_id_view
|
||||||
lq__event_obj={lq__event_obj}
|
lq__event_obj={lq__event_obj}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ let prom_api__event_obj: any;
|
|||||||
|
|
||||||
let disable_submit_btn = true;
|
let disable_submit_btn = true;
|
||||||
|
|
||||||
$: if (browser) {
|
// $: if (browser) {
|
||||||
document.body.scrollIntoView();
|
// document.body.scrollIntoView();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if ($idaa_slct.event_id) {
|
if ($idaa_slct.event_id) {
|
||||||
// console.log(`Event ID selected: ${$idaa_slct.event_id}`);
|
// console.log(`Event ID selected: ${$idaa_slct.event_id}`);
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ if ($idaa_slct.event_id) {
|
|||||||
$slct_trigger = 'load__event_obj';
|
$slct_trigger = 'load__event_obj';
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (browser && $lq__event_obj?.event_id) {
|
// $: if (browser && $lq__event_obj?.event_id) {
|
||||||
document.body.scrollIntoView();
|
// document.body.scrollIntoView();
|
||||||
|
|
||||||
const url = new URL(location);
|
// const url = new URL(location);
|
||||||
url.searchParams.set('event_id', $lq__event_obj?.event_id);
|
// url.searchParams.set('event_id', $lq__event_obj?.event_id);
|
||||||
history.pushState({}, '', url);
|
// history.pushState({}, '', url);
|
||||||
}
|
// }
|
||||||
|
|
||||||
onDestroy(() => {
|
// onDestroy(() => {
|
||||||
console.log('** Component Destroyed: ** View - Event Obj');
|
// console.log('** Component Destroyed: ** View - Event Obj');
|
||||||
|
|
||||||
const url = new URL(location);
|
// const url = new URL(location);
|
||||||
url.searchParams.delete('event_id');
|
// url.searchParams.delete('event_id');
|
||||||
history.pushState({}, '', url);
|
// history.pushState({}, '', url);
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
// dayjs.extend(window.dayjs_plugin_utc)
|
// dayjs.extend(window.dayjs_plugin_utc)
|
||||||
@@ -53,6 +53,12 @@ onDestroy(() => {
|
|||||||
|
|
||||||
<section class="svelte_component ae_section ae_view event_obj view__event_obj space-y-2">
|
<section class="svelte_component ae_section ae_view event_obj view__event_obj space-y-2">
|
||||||
|
|
||||||
|
<h2 class="ae_title event__title text-2xl font-bold">
|
||||||
|
<!-- <span class="ae_icon fas fa-calendar-alt"></span> -->
|
||||||
|
<span class="ae_icon fas fa-calendar-day"></span>
|
||||||
|
{$lq__event_obj?.name ? $lq__event_obj?.name : 'Recovery Meeting'}
|
||||||
|
</h2>
|
||||||
|
|
||||||
<div class="p-2 bg-white shadow-md rounded-lg">
|
<div class="p-2 bg-white shadow-md rounded-lg">
|
||||||
<div
|
<div
|
||||||
class="meeting_description description mb-4"
|
class="meeting_description description mb-4"
|
||||||
|
|||||||
@@ -330,7 +330,9 @@ $effect(() => {
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<section
|
<section
|
||||||
class="module_main_content main_content grow px-1 md:px-2 pb-28"
|
class="
|
||||||
|
module_main_content main_content grow px-1 md:px-2 pb-28
|
||||||
|
"
|
||||||
>
|
>
|
||||||
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
|
|||||||
Reference in New Issue
Block a user