Finally got things mostly working.

This commit is contained in:
Scott Idem
2024-02-20 18:05:18 -05:00
parent 5bb9134641
commit d51d059535
12 changed files with 660 additions and 225 deletions

View File

@@ -1,24 +1,31 @@
<script lang="ts">
export let data;
console.log(`Svelte page data:`, data);
import { onMount } from 'svelte';
export let data;
console.log(`Svelte Sponsorships [slug] page data:`, data);
import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
// To retrieve the store, getModalStore must be invoked at the top level of your component!
import { getDrawerStore, getModalStore } from '@skeletonlabs/skeleton';
import type {
DrawerSettings,
ModalSettings
, ModalComponent, ModalStore
ModalSettings,
ModalComponent,
ModalStore
} from '@skeletonlabs/skeleton';
const modalStore = getModalStore();
import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
import Edit_modal_sponsorship_obj from '../10_edit_modal__sponsorship_obj.svelte';
type key_val = {
[key: string]: any;
};
// Editing
const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_sponsorship_obj };
const modal_edit__sponsorship_obj: ModalSettings = {
@@ -28,11 +35,14 @@ const modal_edit__sponsorship_obj: ModalSettings = {
position: '', // default is "items-center"
};
$ae_loc.hostname = data.url.hostname;
$ae_loc.site_domain = data.url.origin;
onMount(() => {
console.log('Sponsorships [New/Edit]: +page.svelte');
console.log(`$ae_loc = `, $ae_loc);
// console.log(`$ae_loc = `, $ae_loc);
let url = window.location.href;
console.log(url);
@@ -45,8 +55,6 @@ onMount(() => {
// console.log(`$ae_loc.href_url = `, $ae_loc.href_url);
// Load the Sponsorship Cfg Obj with ID based on the URL param.
$slct.sponsorship_cfg_id = data.url.searchParams.get('sponsorship_cfg_id');
$slct_trigger = 'load__sponsorship_cfg_obj';
@@ -173,7 +181,7 @@ async function handle_load_ae_obj_id__sponsorship({sponsorship_id, try_cache=fal
<section>More information goes here.</section>
<section class="btn btn-group">
<!-- <section class="btn btn-group"> -->
<button
class="btn variant-ghost-primary"
on:click={() => {
@@ -185,6 +193,6 @@ async function handle_load_ae_obj_id__sponsorship({sponsorship_id, try_cache=fal
<span class="fas fa-edit mx-1"></span>
Start/Edit Sponsorship
</button>
</section>
<!-- </section> -->
</section>