Changes. Work on new review page searching.

This commit is contained in:
Scott Idem
2024-03-06 20:39:38 -05:00
parent aa712284ce
commit b020ded01c
11 changed files with 848 additions and 182 deletions

View File

@@ -8,13 +8,13 @@ import type { key_val } from '$lib/ae_stores';
export async function load({ params, parent, url }) { // route
// console.log(`Svelte Sponsorships layout.ts data = params:`, params);
// console.log(`Svelte Sponsorships layout.ts data = route:`, route);
// console.log(`Svelte Sponsorships layout.ts data = url:`, url);
// console.log(`Svelte Sponsorships +layout.ts data.params:`, params);
// console.log(`Svelte Sponsorships +layout.ts data.route:`, route);
// console.log(`Svelte Sponsorships +layout.ts data.url:`, url);
// const { ae_init, root_layout_ts } = await parent();
let data = await parent();
console.log(`Svelte Sponsorships layout.ts data = data:`, data);
// console.log(`ae_events_badges +layout.ts data:`, data);
data.ae_sponsorships_layout_ts = true;

View File

@@ -1,154 +0,0 @@
<script lang="ts">
import type { SvelteComponent } from 'svelte';
import { createEventDispatcher, onMount } from 'svelte';
// const dispatch = createEventDispatcher();
// import { localStorageStore } from '@skeletonlabs/skeleton';
// import type { Writable } from 'svelte/store';
// const store_current_tab: Writable<string> = localStorageStore('store_current_tab', 'start');
let store_current_tab: string = 'start';
// console.log(`store_current_tab:`, $store_current_tab);
// Stores
import { getModalStore, FileDropzone, TabGroup, Tab, TabAnchor } from '@skeletonlabs/skeleton';
import { ae_util } from '$lib/ae_utils';
import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
type key_val = {
[key: string]: any;
};
// Props
/** Exposes parent props to this component. */
export let parent: SvelteComponent;
// const modalStore = getModalStore();
onMount(() => {
console.log('** Component Mounted: ** Edit Modal - Sponsorship Obj');
});
// // Form Data
// const formData = {
// name: 'Jane Doe',
// tel: '214-555-1234',
// email: 'jdoe@email.com'
// };
// const form_data = $slct.sponsorship_obj;
// We've created a custom submit function to pass the response and close the modal.
// function onFormSubmit(): void {
// if ($modalStore[0].response) $modalStore[0].response(formData);
// modalStore.close();
// }
// let tab_set = $store_current_tab;
let tab_set = store_current_tab;
$ae_loc.mod.sponsorships.disable_submit__sponsorship_obj = false;
let placeholder_li: key_val = {
file_logo_primary: '-- No File Selected --',
file_logo_secondary: '-- No File Selected --',
file_media_promo_video: '-- No File Selected --',
};
let ae_promises_init: key_val = {};
let ae_promises: key_val = {};
// let ae_promises.api_create__sponsorship_obj: Promise<any>;
if ($slct.sponsorship_id && $slct.sponsorship_obj) {
console.log(`Sponsorship ID selected: ${$slct.sponsorship_id}`);
console.log(`Sponsorship object selected:`, $slct.sponsorship_obj);
// $slct_trigger = 'load__sponsorship_obj';
} else {
$slct.sponsorship_id = null;
$slct.sponsorship_obj = {
sponsorship_cfg_id_random: $ae_loc.mod.sponsorships.sponsorship_cfg_id,
name: null,
description: null,
poc_person_id: null,
logo_li_json: null,
media_li_json: null,
social_li_json: null,
guest_li_json: null,
level_num: null,
level_str: null,
amount: null,
paid: null,
enable: null,
};
}
// Base Classes
const cBase = 'card p-4 w-modal-wide shadow-xl space-y-4 ae_modal_scrollfix';
// const cBase = 'bg-surface-100-800-token w-screen h-screen';
// const cBase = 'card h-screen';
// const cBase = 'card p-4 w-modal-wide h-screen shadow-xl space-y-4';
const cHeader = 'text-2xl font-bold';
const cForm = 'border border-surface-200 p-4 space-y-4 rounded-container-token';
</script>
<!-- @component This is the Sponsorships modal edit form. -->
<!-- {#if $modalStore[0]} -->
<section class="modal-example-form {cBase}">
<!-- <header class={cHeader}>{$modalStore[0].title ?? '-- No Title --'}</header> -->
<header class={cHeader}>Start/Edit Sponsorship</header>
here....
<!-- </form> -->
<!-- prettier-ignore -->
<footer class="modal-footer {parent.regionFooter}">
{#if $slct.sponsorship_id}
<!-- {#if $ae_loc.administrator_access} -->
<button
on:click={() => {
// if (!confirm('Are you sure you want to delete this sponsorship?')) {return false;}
// handle_delete_sponsorship_obj({sponsorship_id: $slct.sponsorship_id, method: 'delete'});
// $slct.sponsorship_id = null;
// $slct.sponsorship_obj = {};
}}
class="btn {parent.buttonNegative}"
title="Delete record permanently"
>
<span class="fas fa-minus mx-1"></span> Delete
</button>
<!-- {/if} -->
{/if}
<button class="btn {parent.buttonNeutral}" on:click={parent.onClose}>
<span class="fas fa-window-close mx-1"></span>
{parent.buttonTextCancel}
</button>
</footer>
</section>
<!-- {/if} -->
<style>
</style>