Cleaning up code and making everything look better.

This commit is contained in:
Scott Idem
2024-02-27 18:38:46 -05:00
parent 22efa3fd96
commit 714642380e
6 changed files with 118 additions and 60 deletions

View File

@@ -1200,33 +1200,29 @@ async function handle_update__sponsorship({
</TabGroup>
<!-- </form> -->
<!-- prettier-ignore -->
<footer class="modal-footer {parent.regionFooter}">
<footer class="{parent.regionFooter}">
{#if $slct.sponsorship_id}
<!-- {#if $ae_loc.administrator_access} -->
<!-- {#if $ae_loc.trusted_access} -->
<button
on:click={() => {
// if (!confirm('Are you sure you want to delete this sponsorship?')) {return false;}
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}"
class="btn variant-filled-warning mx-1"
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 class="btn variant-filled-primary" on:click={parent.onClose}>
<span class="fas fa-times mx-1"></span>
Close
</button>
<!-- <button class="btn {parent.buttonPositive}" on:click={handle_submit_form}>
<span class="fas fa-check mx-1"></span>
Submit Form
</button> -->
<!-- {#if $slct.sponsorship_id}
<button

View File

@@ -6,6 +6,7 @@ import { createEventDispatcher, onMount } from 'svelte';
// import { getModalStore } 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';
// Props
@@ -37,6 +38,14 @@ onMount(() => {
<header class={container_header_class_li}>{@html $slct.sponsorship_obj.name}</header>
<div class="sponsorship__content">
<div class="sponsorship__poc">
<span class="ae_label">Point of Contact:</span>
<span class="ae_value">{@html $slct.sponsorship_obj.poc_json.full_name}</span>
<span class="ae_label">| Email:</span>
<span class="ae_value"><span class="fas fa-envelope"></span> {$slct.sponsorship_obj.poc_json.email}</span>
<span class="ae_label">| Mobile:</span>
<span class="ae_value"><span class="fas fa-mobile-alt"></span> {$slct.sponsorship_obj.poc_json.phone_mobile ?? '-- Not Given --'}</span>
<div
class="sponsorship_description description"
>
@@ -126,38 +135,50 @@ onMount(() => {
</div>
<footer class="modal-footer {parent.regionFooter}">
<footer class="{parent.regionFooter}">
{#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}
<div class="ae_options">
<div class="ae_options mx-1">
<button
class="btn variant-filled-warning mx-1"
on:click={() => {
if (!confirm(`Are you sure you want to send this email to ${$slct.sponsorship_obj.poc_json.email}?`)) {return false;}
api.send_email({
api_cfg: $ae_api,
from_email: 'scott.idem+from@oneskyit.com',
from_name: 'Scott Idem',
to_email: $slct.sponsorship_obj.poc_json.email,
subject: 'Test Email',
body_html: 'This is a test email from the AE system.',
});
}}
>
<span class="fas fa-paper-plane mx-1
"></span>
Send Email
</button>
<button
on:click={() => {
// $slct.sponsorship_id = $slct.sponsorship_obj.sponsorship_id_random;
// $slct.sponsorship_obj = $slct.sponsorship_obj;
// const url = new URL(location);
// url.searchParams.set('sponsorship_id', $slct.sponsorship_obj.sponsorship_id_random);
// history.pushState({}, '', url);
// $ae_loc.mod.sponsorships.show_main__options = true;
// $ae_loc.mod.sponsorships.show_list__sponsorship_obj_li = true;
// $slct_trigger = 'load__sponsorship_obj';
$ae_loc.mod.sponsorships.show_view__sponsorship_obj = false;
$ae_loc.mod.sponsorships.show_edit__sponsorship_obj = true;
parent.onClose();
$slct_trigger = 'show_edit__sponsorship_obj';
}}
class="btn variant-filled"
class="btn variant-filled-warning mx-1"
title={`Edit sponsorship: ${$slct.sponsorship_obj.name}`}
>
<span class="fas fa-edit"></span> Edit
<span class="fas fa-edit mx-1"></span> Edit
</button>
</div>
{/if}
<button
class="btn {parent.buttonNeutral}"
class="btn variant-filled-primary mx-1"
on:click={() => {parent.onClose();}}
>
{parent.buttonTextCancel}
<span class="fas fa-times mx-1"></span>
Close
</button>
</footer>