Wrapping up for the night. Things are working better. There are still API request misses or something.

This commit is contained in:
Scott Idem
2024-03-05 20:35:38 -05:00
parent bed4f4a0f2
commit e71cdab353
10 changed files with 261 additions and 139 deletions

View File

@@ -4,15 +4,14 @@ import { onMount } from 'svelte';
import { fade } from 'svelte/transition';
function number_w_commas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
// This works and uses local storage:
// store_current_tab must be prefixed with $ to be reactive.
import { clipboard, FileDropzone, getModalStore, localStorageStore, ProgressRadial, TabGroup, Tab, TabAnchor } from '@skeletonlabs/skeleton';
import type { Writable } from 'svelte/store';
import Element_data_store from '$lib/element_data_store.svelte';
const store_current_tab: Writable<string> = localStorageStore('ae_events_speakers_current_tab', 'start');
console.log(`store_current_tab:`, $store_current_tab);
@@ -52,7 +51,6 @@ onMount(() => {
}
});
const cForm = 'border border-surface-200 p-4 space-y-4 rounded-container-token';
let ae_promises: key_val = {}; // Promise<any>;
@@ -555,7 +553,7 @@ async function handle_update__event_presenter({
<p>The details provided will be used to list you as a speaker in our CHOW promotional materials and during CHOW in the event mobile app, speaker introductions, etc.</p>
<form
class="modal-form {cForm}"
class="modal-form {$ae_loc.hub.classes__form}"
on:submit|preventDefault={handle_submit_form}
>
@@ -636,7 +634,17 @@ async function handle_update__event_presenter({
<!-- </section> -->
<fieldset class="mb-8">
<legend class="legend input_required">Agreements & Accommodations</legend>
<legend class="legend input_required">Agreements</legend>
<!-- <Element_data_store
ds_code="events_speakers__form__waiver_html"
ds_type="html"
for_type="devent"
for_id={$slct.event_id}
ds_name="Default: Events Speakers Form - Waiver HTML"
display="block"
class_li=""
/> -->
<label for="agree" class="label">
<input
@@ -650,6 +658,18 @@ async function handle_update__event_presenter({
>
Yes, I grant the Foundation permission to use my biography, photo, and presentation, materials and verbal remarks on the Foundation website and promotional materials. I understand that summarized remarks will be sent to me for review prior to inclusion.
</label>
<!-- <label for="agree" class="label">
<input
type="checkbox"
class="checkbox variant-glass-warning"
id="agree"
name="agree"
value="1"
checked={$slct.event_presenter_obj.agree}
required
>
Yes, I understand the permissions.
</label> -->
<!-- <label for="accommodations" class="label">
<input
@@ -666,7 +686,7 @@ async function handle_update__event_presenter({
<button
type="submit"
class="btn variant-filled-primary m-2"
class="btn variant-glass-primary m-2"
disabled={($ae_sess.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Start save and email button clicked ***');
@@ -692,7 +712,7 @@ async function handle_update__event_presenter({
<button
type="submit"
class="btn variant-filled-primary m-2"
class="btn variant-glass-primary m-2"
disabled={($ae_loc.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Save start button clicked ***');
@@ -713,7 +733,7 @@ async function handle_update__event_presenter({
<section class="biograhpy space-y-4">
<form
class="modal-form {cForm}"
class="modal-form {$ae_loc.hub.classes__form}"
on:submit|preventDefault={handle_submit_form}
>
<label class="label ae_label event_presenter__biography required variant-glass-warning space-y-4">
@@ -737,7 +757,7 @@ async function handle_update__event_presenter({
<div class="flex flex-wrap gap-2 p-1">
<button
type="submit"
class="btn {parent.buttonPositive} btn-sm"
class="btn variant-glass-primary m-2"
disabled={($ae_loc.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Save button clicked ***');
@@ -761,7 +781,7 @@ async function handle_update__event_presenter({
<form
class="modal-form {cForm}"
class="modal-form {$ae_loc.hub.classes__form}"
on:submit|preventDefault={handle_submit_form_files}
>
@@ -798,7 +818,7 @@ async function handle_update__event_presenter({
<button
type="submit"
class="btn {parent.buttonPositive}"
class="btn variant-glass-primary m-2"
disabled={($ae_loc.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Save button clicked ***');
@@ -818,7 +838,7 @@ async function handle_update__event_presenter({
<form
class="modal-form {cForm}"
class="modal-form {$ae_loc.hub.classes__form}"
on:submit|preventDefault={handle_submit_form}
>
<!-- Ask for common social media URLs. (Twitter, Facebook, Instagram, etc) -->
@@ -869,7 +889,7 @@ async function handle_update__event_presenter({
<button
type="submit"
class="btn {parent.buttonPositive}"
class="btn variant-glass-primary m-2"
disabled={($ae_loc.mod.events.disable_submit__event_presenter_obj)}
on:click={() => {
console.log('*** Save more button clicked ***');
@@ -902,7 +922,7 @@ async function handle_update__event_presenter({
// $slct.event_presenter_id = null;
// $slct.event_presenter_obj = {};
}}
class="btn variant-filled-warning mx-1"
class="btn variant-glass-warning mx-1"
class:hidden={!$ae_loc.trusted_access}
title="CURRENTLY DISABLED: Delete record permanently"
>
@@ -942,8 +962,8 @@ async function handle_update__event_presenter({
{/await}
<button class="btn variant-filled-primary" on:click={parent.onClose}>
<span class="fas fa-window-close mx-1"></span>
<button class="btn variant-glass-primary" on:click={parent.onClose}>
<span class="fas fa-times mx-1"></span>
Close
</button>

View File

@@ -2,18 +2,28 @@
import type { SvelteComponent } from 'svelte';
import { onMount } from 'svelte';
// Stores
// This works and uses local storage:
// store_current_tab must be prefixed with $ to be reactive.
import { clipboard, FileDropzone, getModalStore, localStorageStore, ProgressRadial, RadioGroup, RadioItem, TabGroup, Tab, TabAnchor } from '@skeletonlabs/skeleton';
import type { Writable } from 'svelte/store';
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';
// Stores
// Props
/** Exposes parent props to this component. */
export let parent: SvelteComponent;
console.log(`Parent:`, parent);
export let container_class_li = '';
const modalStore = getModalStore();
if ($slct.event_presenter_id) {
console.log(`Presenter ID selected: ${$slct.event_presenter_id}`);
console.log(`Presenter object selected:`, $slct.event_presenter_obj);
@@ -29,10 +39,16 @@ onMount(() => {
<!-- @component This is the Presenters modal view form. -->
{#if $modalStore[0]}
<section class="svelte_component ae_view_modal ae_obj__event_presenter {container_class_li} p-4 space-y-4">
<header class={parent.regionHeader}>
{@html $slct.event_presenter_obj.full_name}
<button class="btn variant-glass-primary float-end" on:click={parent.onClose}>
<span class="fas fa-times mx-1"></span>
Close
</button>
</header>
<p>This quick view of a presenter's information is customizable or can be hidden completely.</p>
@@ -109,10 +125,11 @@ onMount(() => {
</div>
<footer class="{parent.regionFooter}">
{#if $ae_loc.trusted_access || $slct.event_presenter_obj.external_person_id === $ae_loc.ae_uuid || $slct.event_presenter_obj.email === $ae_loc.ae_email}
<span>
{#if $ae_loc.trusted_access}
<span class="ae_options mx-1">
<button
class="btn variant-filled-warning mx-1"
class="btn variant-glass-warning mx-1"
on:click={() => {
if (!confirm(`Are you sure you want to send this email to ${$slct.event_presenter_obj.email}?`)) {return false;}
@@ -127,8 +144,7 @@ onMount(() => {
}}
>
<span class="fas fa-paper-plane mx-1
"></span>
<span class="fas fa-paper-plane mx-1"></span>
Send Email
</button>
@@ -139,7 +155,7 @@ onMount(() => {
parent.onClose();
$slct_trigger = 'show_edit__event_presenter_obj';
}}
class="btn variant-filled-warning mx-1"
class="btn variant-glass-warning mx-1"
title={`Edit presenter: ${$slct.event_presenter_obj.name}`}
>
<span class="fas fa-edit mx-1"></span> Edit
@@ -147,20 +163,15 @@ onMount(() => {
</span>
{/if}
<!-- <button
class="btn variant-filled-primary mx-1"
on:click={() => {parent.onClose();}}
>
<span class="fas fa-times mx-1"></span>
Close
</button> -->
<button class="btn variant-glass-primary" on:click={parent.onClose}>
<span class="fas fa-times mx-1"></span>
Close
</button>
</footer>
</section>
{/if}
<style>