Cleaning up code and making everything look better.
This commit is contained in:
@@ -1207,7 +1207,15 @@ export let delete_ae_obj_id_crud = async function delete_ae_obj_id_crud({api_cfg
|
||||
/* BEGIN: Hosted File Related */
|
||||
|
||||
// Updated 2023-08-17
|
||||
export let download_hosted_file = async function download_hosted_file({api_cfg, hosted_file_id, return_file=true, filename=null, auto_download=false, params={}, log_lvl=0}) {
|
||||
export let download_hosted_file = async function download_hosted_file({
|
||||
api_cfg,
|
||||
hosted_file_id,
|
||||
return_file=true,
|
||||
filename=null,
|
||||
auto_download=false,
|
||||
params={},
|
||||
log_lvl=0
|
||||
}) {
|
||||
console.log('*** stores_hosted_api.js: download_hosted_file() ***');
|
||||
|
||||
const endpoint = `/hosted_file/${hosted_file_id}/download`;
|
||||
@@ -1246,7 +1254,14 @@ export let delete_hosted_file = async function delete_hosted_file({api_cfg, host
|
||||
/* BEGIN: Data Store Related */
|
||||
|
||||
// Updated 2023-06-29
|
||||
export let get_data_store_obj_w_code = async function get_data_store_obj_w_code({api_cfg, data_store_code, data_type='text', headers={}, params={}, log_lvl=0}) {
|
||||
export let get_data_store_obj_w_code = async function get_data_store_obj_w_code({
|
||||
api_cfg,
|
||||
data_store_code,
|
||||
data_type='text',
|
||||
headers={},
|
||||
params={},
|
||||
log_lvl=0
|
||||
}) {
|
||||
if (log_lvl) {
|
||||
console.log('*** get_data_store_obj_w_code() ***');
|
||||
}
|
||||
|
||||
@@ -200,8 +200,11 @@ $: if ($slct_trigger == 'set_access_code_li' && !$ae_loc.ds['hub__page__access_c
|
||||
// }
|
||||
</script>
|
||||
|
||||
<!-- regionFooter="flex justify-end space-x-2" -->
|
||||
|
||||
<Modal components={modalRegistry} />
|
||||
<Modal components={modalRegistry}
|
||||
regionFooter='flex justify-between space-x-2'
|
||||
/>
|
||||
|
||||
|
||||
<Drawer>
|
||||
|
||||
@@ -873,33 +873,29 @@ async function handle_update__sponsorship({
|
||||
</TabGroup>
|
||||
|
||||
<!-- </form> -->
|
||||
<!-- prettier-ignore -->
|
||||
|
||||
<footer class="modal-footer {parent.regionFooter}">
|
||||
{#if $slct.event_presenter_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 presenter?')) {return false;}
|
||||
// handle_delete_event_presenter_obj({event_presenter_id: $slct.event_presenter_id, method: 'delete'});
|
||||
|
||||
// $slct.event_presenter_id = null;
|
||||
// $slct.event_presenter_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}>
|
||||
<button class="btn variant-filled-primary" on:click={parent.onClose}>
|
||||
<span class="fas fa-window-close mx-1"></span>
|
||||
{parent.buttonTextCancel}
|
||||
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.event_presenter_id}
|
||||
<button
|
||||
|
||||
@@ -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
|
||||
@@ -44,6 +45,20 @@ onMount(() => {
|
||||
<pre class="ae_value event_presenter__biography">{@html $slct.event_presenter_obj.biography ? $slct.event_presenter_obj.biography : '-- No Bio Given --'}</pre>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="event_presenter__affiliations"
|
||||
>
|
||||
<span class="ae_label">Affiliations:</span>
|
||||
<span class="ae_value">{@html $slct.event_presenter_obj.affiliations ? $slct.event_presenter_obj.affiliations : '-- No Affiliations Given --'}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="event_presenter__email"
|
||||
>
|
||||
<span class="ae_label">Email:</span>
|
||||
<span class="ae_value"><span class="fas fa-envelope"></span> {$slct.event_presenter_obj.email}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class:ae_d_none={!$slct.event_presenter_obj.phone_mobile}
|
||||
class="event_presenter_phone_mobile"
|
||||
@@ -95,39 +110,51 @@ onMount(() => {
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="modal-footer {parent.regionFooter}">
|
||||
{#if $ae_loc.trusted_access || $slct.event_presenter_obj.external_person_id === $ae_loc.novi_uuid || $slct.event_presenter_obj.contact_1_email === $ae_loc.novi_email}
|
||||
<div class="ae_options">
|
||||
<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>
|
||||
<button
|
||||
class="btn variant-filled-warning mx-1"
|
||||
on:click={() => {
|
||||
if (!confirm(`Are you sure you want to send this email to ${$slct.event_presenter_obj.email}?`)) {return false;}
|
||||
|
||||
api.send_email({
|
||||
api_cfg: $ae_api,
|
||||
from_email: 'scott.idem+from@oneskyit.com',
|
||||
from_name: 'Scott Idem',
|
||||
to_email: $slct.event_presenter_obj.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.event_presenter_id = $slct.event_presenter_obj.event_presenter_id_random;
|
||||
// $slct.event_presenter_obj = $slct.event_presenter_obj;
|
||||
|
||||
// const url = new URL(location);
|
||||
// url.searchParams.set('event_presenter_id', $slct.event_presenter_obj.event_presenter_id_random);
|
||||
// history.pushState({}, '', url);
|
||||
|
||||
// $ae_loc.mod.events.show_main__options = true;
|
||||
// $ae_loc.mod.events.show_list__event_presenterj_li = true;
|
||||
// $slct_trigger = 'load__event_presenter_obj';
|
||||
|
||||
$ae_loc.mod.events.show_view__event_presenter_obj = false;
|
||||
$ae_loc.mod.events.show_edit__event_presenter_obj = true;
|
||||
parent.onClose();
|
||||
$slct_trigger = 'show_edit__event_presenter_obj';
|
||||
}}
|
||||
class="btn variant-filled"
|
||||
class="btn variant-filled-warning mx-1"
|
||||
title={`Edit presenter: ${$slct.event_presenter_obj.name}`}
|
||||
>
|
||||
<span class="fas fa-edit"></span> Edit
|
||||
<span class="fas fa-edit mx-1"></span> Edit
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
{/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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user