Work on style updates. Able to create new meetings again.

This commit is contained in:
Scott Idem
2025-06-27 17:36:00 -04:00
parent e87fae34f8
commit 4c0b1d4c50
7 changed files with 172 additions and 251 deletions

View File

@@ -34,14 +34,14 @@ import Comp__event_obj_id_edit from './ae_idaa_comp__event_obj_id_edit.svelte';
import Comp__event_obj_id_view from './ae_idaa_comp__event_obj_id_view.svelte';
let event_id = page.url.searchParams.get('event_id') ?? null;
if (!event_id) {
$idaa_slct.event_id = null;
} else {
console.log(`ae Recovery Meetings - [event_id] +page.ts: event_id = `, event_id);
$idaa_slct.event_id = event_id;
$idaa_trig.event_id = event_id;
}
// let event_id = page.url.searchParams.get('event_id') ?? null;
// if (!event_id) {
// $idaa_slct.event_id = null;
// } else {
// console.log(`ae Recovery Meetings - [event_id] +page.ts: event_id = `, event_id);
// $idaa_slct.event_id = event_id;
// $idaa_trig.event_id = event_id;
// }
let event_id_random_li: Array<string> = $state();
@@ -100,12 +100,12 @@ let lq_new__event_obj_li = $derived(liveQuery(async () => {
}
}));
let lq__event_obj = $derived(liveQuery(async () => {
let results = await db_events.events
.get($idaa_slct.event_id ?? '');
// let lq__event_obj = $derived(liveQuery(async () => {
// let results = await db_events.events
// .get($idaa_slct.event_id ?? '');
return results;
}));
// return results;
// }));
// This (event_li trigger for IDAA) is not currently being used.
@@ -436,8 +436,7 @@ function add_activity_log(
<svelte:head>
<title>
IDAA Recovery Meetings:
{$lq__event_obj?.name ? ae_util.shorten_string({ string: $lq__event_obj?.name, max_length: 20, begin_length: 10, end_length: 4 }) : ''}
IDAA Recovery Meetings
- Novi - {$ae_loc?.title}
</title>
</svelte:head>
@@ -478,184 +477,3 @@ function add_activity_log(
<!-- </div> -->
<!-- Modal: Event (Recovery Meeting) edit ID -->
<!-- title="{$lq__event_obj?.name} - {$lq__event_obj?.id}" -->
<Modal
bind:open={$idaa_sess.recovery_meetings.show__modal_edit__event_id}
autoclose={false}
placement="top-center"
size="xl"
class="top-center bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
>
{#snippet header()}
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-lg font-semibold">
{#if $ae_loc.trusted_access || $lq__event_obj?.external_person_id === $idaa_loc.novi_uuid || $lq__event_obj?.contact_li_json[0]?.email === $idaa_loc.novi_email}
<!-- <div class="ae_options"> -->
<button
onclick={() => {
// const url = new URL(location);
// url.searchParams.set('event_id', $lq__event_obj?.event_id_random);
// history.pushState({}, '', url);
$idaa_sess.recovery_meetings.show__modal_edit = false;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = false;
$idaa_sess.recovery_meetings.show__modal_view = true;
$idaa_sess.recovery_meetings.show__modal_view__event_id = $lq__event_obj?.event_id;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'cancel_edit',
}
);
}}
class="novi_btn btn btn-sm btn-warning preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
title={`View meeting: ${$lq__event_obj?.name}`}
>
<span class="fas fa-times m-1"></span> Cancel Edit
</button>
<!-- </div> -->
{/if}
<span class="fas fa-calendar-day m-1"></span>
{$lq__event_obj?.name ?? 'New Recovery Meeting'}
</h3>
</div>
{/snippet}
<Comp__event_obj_id_edit
lq__event_obj={lq__event_obj}
/>
{#snippet footer()}
<div class="text-center w-full">
<button
type="button"
onclick={() => {
console.log('Close modal');
$idaa_sess.recovery_meetings.show__modal_edit = false;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'close_modal',
}
);
}}
class="novi_btn btn btn-warning btn-sm preset-tonal-warning hover:preset-tonal-warning border border-warning-500"
>
<span class="fas fa-times mx-1"></span>
Close
</button>
</div>
{/snippet}
</Modal>
<!-- Modal: Event (Recovery Meeting) view ID -->
<!-- title="{$lq__event_obj?.name} - {$lq__event_obj?.id}" -->
<Modal
bind:open={$idaa_sess.recovery_meetings.show__modal_view__event_id}
autoclose={false}
outsideclose={true}
placement="top-center"
size="lg"
class="top-center bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200 rounded-lg border-gray-200 dark:border-gray-700 divide-gray-200 dark:divide-gray-700 shadow-md relative flex flex-col mx-auto w-full divide-y"
>
{#snippet header()}
<div class="flex flex-row items-center justify-between w-full">
<h3 class="text-lg font-semibold text-center">
{#if $ae_loc.trusted_access || $lq__event_obj?.external_person_id === $idaa_loc.novi_uuid || $lq__event_obj?.contact_li_json[0].email === $idaa_loc.novi_email}
<button
onclick={() => {
// const url = new URL(location);
// url.searchParams.set('event_id', $lq__event_obj?.event_id_random);
// history.pushState({}, '', url);
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = true;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = $lq__event_obj?.event_id;
add_activity_log(
{
action: 'idaa_meetings_page',
action_with: 'edit',
}
);
}}
class="novi_btn btn btn-warning btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
title={`Edit meeting: ${$lq__event_obj?.name}`}
>
<span class="fas fa-edit m-1"></span> Edit
</button>
{/if}
<span class="">
<span class="fas fa-calendar-day m-1"></span>
{$lq__event_obj?.name ?? '-- not set --'}
</span>
</h3>
{#if $lq__event_obj?.status == 'unknown'}
<span class="badge badge-warning preset-tonal-error" title="This meeting has not been confirmed by IDAA Central Office. Please reach out to the chair for current meeting list info. Meeting attendees can reach out to info@idaa.org if they know this is information is accurate and this meeting is still taking place.">
<span class="fas fa-exclamation-triangle m-1"></span>
Not Confirmed by IDAA
<!-- Unknown Status -->
<span class="fas fa-exclamation-triangle m-1"></span>
</span>
{/if}
</div>
<button
type="button"
class="novi_btn btn btn-sm btn-secondary absolute top-2 right-2"
onclick={() => {
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = false;
$idaa_sess.recovery_meetings.show__modal_edit__event_id = false;
$idaa_slct.event_id = null;
$idaa_slct.event_obj = null;
let message = {'event_id': $idaa_slct.event_id ?? null};
window.parent.postMessage(message, "*");
}}
>
<span class="fas fa-times"></span>
Close
</button>
{/snippet}
<Comp__event_obj_id_view
lq__event_obj={lq__event_obj}
/>
{#snippet footer()}
<button
type="button"
class="btn btn-sm btn-secondary"
onclick={() => {
$idaa_sess.recovery_meetings.show__modal_view = false;
$idaa_sess.recovery_meetings.show__modal_view__event_id = false;
$idaa_sess.recovery_meetings.show__modal_edit = false;
$idaa_sess.recovery_meetings.show__inline_edit__event_obj = false;
$idaa_slct.event_id = null;
$idaa_slct.event_obj = null;
let message = {'event_id': $idaa_slct.event_id ?? null};
window.parent.postMessage(message, "*");
}}
>
<span class="fas fa-times"></span>
Close
</button>
{/snippet}
</Modal>