diff --git a/src/routes/events_speakers/+page.svelte b/src/routes/events_speakers/+page.svelte index e29d5c9f..b30360b9 100644 --- a/src/routes/events_speakers/+page.svelte +++ b/src/routes/events_speakers/+page.svelte @@ -34,6 +34,8 @@ const modal_edit__event_presenter_obj: ModalSettings = { component: modalComponentEditEventPresenterObj, title: 'Edit Event Presenter', position: '', // default is "items-center" + + response: (r: boolean | undefined) => handle_modal_close(r) }; // Viewing @@ -55,8 +57,19 @@ const modal_view__event_presenter_obj: ModalSettings = { // component_root_classes: 'w-full', // fn: do_something_function // }, + + response: (r: boolean | undefined) => handle_modal_close(r) }; +function handle_modal_close(response: boolean | undefined) { + console.log('Modal closed. Response:', response); + + let location = window.location.href; + const url = new URL(location); + url.searchParams.delete('event_presenter_id'); + history.pushState({}, '', url); +} + // We don't want the edit or view to show up by default. Maybe if we see an object ID param in the URL, we can show the view modal. $ae_loc.mod.events.show_edit__event_presenter_obj = false; $ae_loc.mod.sponsorships.show_view__event_presenter_obj = false; diff --git a/src/routes/events_speakers/10_view_modal__event_presenter_obj.svelte b/src/routes/events_speakers/10_view_modal__event_presenter_obj.svelte index f25a322d..e7366029 100644 --- a/src/routes/events_speakers/10_view_modal__event_presenter_obj.svelte +++ b/src/routes/events_speakers/10_view_modal__event_presenter_obj.svelte @@ -125,15 +125,7 @@ onMount(() => { {/if} diff --git a/src/routes/sponsorships/+page.svelte b/src/routes/sponsorships/+page.svelte index fb2e5f9e..e67fa694 100644 --- a/src/routes/sponsorships/+page.svelte +++ b/src/routes/sponsorships/+page.svelte @@ -36,12 +36,7 @@ const modal_edit__sponsorship_obj: ModalSettings = { title: 'Edit Sponsorship', position: '', // default is "items-center" - // Provide arbitrary classes to the backdrop and modal elements: - // backdropClasses: '!bg-green-500', - // modalClasses: 'w-modal-wide', - - // Provide arbitrary metadata to your modal instance: - // meta: { fn: do_something_function } + response: (r: boolean | undefined) => handle_modal_close(r) }; // Viewing @@ -59,8 +54,19 @@ const modal_view__sponsorship_obj: ModalSettings = { // Provide arbitrary metadata to your modal instance: // meta: { fn: do_something_function } + + response: (r: boolean | undefined) => handle_modal_close(r) }; +function handle_modal_close(response: boolean | undefined) { + console.log('Modal closed. Response:', response); + + let location = window.location.href; + const url = new URL(location); + url.searchParams.delete('event_presenter_id'); + history.pushState({}, '', url); +} + // We don't want the edit or view to show up by default. Maybe if we see an object ID param in the URL, we can show the view modal. $ae_loc.mod.sponsorships.show_edit__sponsorship_obj = false; $ae_loc.mod.sponsorships.show_view__sponsorship_obj = false; diff --git a/src/routes/sponsorships/10_view__sponsorship_obj.svelte b/src/routes/sponsorships/10_view__sponsorship_obj.svelte deleted file mode 100644 index c8ddc91a..00000000 --- a/src/routes/sponsorships/10_view__sponsorship_obj.svelte +++ /dev/null @@ -1,195 +0,0 @@ - - - -
- -
-

{@html $slct.sponsorship_obj.name}

-
- -
-
-
Description:
-
{@html $slct.sponsorship_obj.description ? $slct.sponsorship_obj.description : '-- No Description Given --'}
-
- -
- Level of Sponsorship: - {$slct.sponsorship_obj.level_num} — {$slct.sponsorship_obj.level_str} -
- -
- Paid: - $ - - {$slct.sponsorship_obj.paid ? 'Yes, marked as paid' : 'Not yet marked as paid'} - -
- - - -
-

Guest List

- - {#if $slct.sponsorship_obj.guest_li_json && $slct.sponsorship_obj.guest_li_json.length && $slct.sponsorship_obj.guest_li_json[0].full_name} - - {:else} -
No guest list found!
- {/if} - -
- -
-
- - ID: - {$slct.sponsorship_obj.sponsorship_id_random} - - - Created on: {ae_util.iso_datetime_formatter($slct.sponsorship_obj.created_on, 'datetime_short')} - - - Updated on: {ae_util.iso_datetime_formatter($slct.sponsorship_obj.updated_on, 'datetime_short')} - -
- - {#if $ae_loc.trusted_access || $slct.sponsorship_obj.external_person_id === $ae_loc.novi_uuid || $slct.sponsorship_obj.contact_1_email === $ae_loc.novi_email} -
- -
- {/if} -
- -
- -
- - - diff --git a/src/routes/sponsorships/10_view_modal__sponsorship_obj.svelte b/src/routes/sponsorships/10_view_modal__sponsorship_obj.svelte index 9a692de3..9d6b9fff 100644 --- a/src/routes/sponsorships/10_view_modal__sponsorship_obj.svelte +++ b/src/routes/sponsorships/10_view_modal__sponsorship_obj.svelte @@ -155,15 +155,7 @@ onMount(() => { {/if}