Lots of general clean up and work for CHOW going live

This commit is contained in:
Scott Idem
2024-03-08 11:27:18 -05:00
parent 5a147a98bb
commit 2ada1419d8
11 changed files with 338 additions and 229 deletions

View File

@@ -80,6 +80,11 @@ $ae_loc.site_domain = data.url.origin;
// We don't want the edit or view to show up by default. Maybe if we see an object ID param in the URL, we can show a modal.
$ae_loc.mod.sponsorships.show_edit__sponsorship_obj = false;
$ae_loc.mod.sponsorships.show_view__sponsorship_obj = false;
if ($ae_loc.trusted_access) {
$ae_loc.mod.sponsorships.show_list__sponsorship_obj_li = true;
} else {
$ae_loc.mod.sponsorships.show_list__sponsorship_obj_li = false;
}
let ae_sponsorship_cfg_obj_get_promise: Promise<any>;
let ae_sponsorship_obj_li_get_promise: Promise<any>;

View File

@@ -766,7 +766,7 @@ async function handle_update__sponsorship({
</header>
{#if $slct.sponsorship_id && $ae_loc.mod.sponsorships.link}
<!-- {#if $slct.sponsorship_id && $ae_loc.mod.sponsorships.link}
<div class="flex justify-center">
<button
class="btn variant-soft-secondary"
@@ -802,7 +802,7 @@ async function handle_update__sponsorship({
Send Email
</button>
</div>
{/if}
{/if} -->
<TabGroup
@@ -1339,8 +1339,8 @@ async function handle_update__sponsorship({
console.log('*** Start save and email button clicked ***');
if (!confirm(`This will save your sponsorship information so far and a confirmation email will be sent to ${$slct.sponsorship_obj.poc_json.email}.`)) {return false;}
let subject = `CHOW 2024 Sponsorship Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsorship ID: ${$slct.sponsorship_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`
let subject = `CHOW 2024 Sponsor Hub Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>Use this link to view or update your CHOW 2024 speaker information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`
api.send_email({
api_cfg: $ae_api,
@@ -1616,7 +1616,7 @@ async function handle_update__sponsorship({
}}
>
<span class="fas fa-check mx-1"></span>
Save
Save and continue
</button>
</form>
@@ -1771,7 +1771,7 @@ async function handle_update__sponsorship({
}}
>
<span class="fas fa-check mx-1"></span>
Save
Save and continue
</button>
</form>
@@ -1955,7 +1955,7 @@ async function handle_update__sponsorship({
}}
>
<span class="fas fa-check mx-1"></span>
Save
Save and continue
</button>
</form>
@@ -2265,6 +2265,7 @@ async function handle_update__sponsorship({
<footer class="{parent.regionFooter}">
{#if $slct.sponsorship_id}
<!-- {#if $ae_loc.trusted_access} -->
<span class="ae_actions">
<button
on:click={() => {
if (!confirm('CURRENTLY DISABLED: Are you sure you want to delete this sponsorship?')) {return false;}
@@ -2274,14 +2275,52 @@ async function handle_update__sponsorship({
// $slct.sponsorship_obj = {};
}}
class="btn variant-glass-warning mx-1"
class:hidden={!$ae_loc.trusted_access}
title="Delete record permanently"
class:hidden={!$ae_loc.administrator_access}
title="CURRENTLY DISABLED: Delete record permanently"
>
<span class="fas fa-minus mx-1"></span> Delete
</button>
<!-- {/if} -->
<button
class="btn variant-soft-secondary"
use:clipboard={$ae_loc.mod.sponsorships.link}
title={`Copy link to this sponsorship submission (ID: ${$slct.sponsorship_id})`}
>
<span class="fas fa-copy mx-1"></span>
Copy link for sponsor submission
</button>
<button
class="btn variant-soft-secondary mx-1"
disabled={(!$slct.sponsorship_obj.poc_json.email)}
title="Send confirmation email to POC"
on:click={async () => {
if (!confirm(`Are you sure you want to send this email to ${$slct.sponsorship_obj.poc_json.email}?`)) {return false;}
let subject = `CHOW 2024 Sponsor Hub Link for ${$slct.sponsorship_obj.name} (ID: ${$slct.sponsorship_id})`;
let body_html = `<p>Thank you for your submission to the Sponsorships Hub. You are an integral part of Capitol Hill Ocean Week and we appreciate your participation. If you need to make any changes or updates to your submission, you may access it via the below hyperlink:</p><p>Level: ${$slct.sponsorship_obj.level_str}</p><p>Name: ${$slct.sponsorship_obj.name} (Sponsor ID: ${$slct.sponsorship_id})</p><p>POC: ${$slct.sponsorship_obj.poc_json.full_name} (${$slct.sponsorship_obj.poc_json.email})</p><p>Use this link to view or update your CHOW 2024 sponsorship information.<p>Copy and paste link: <a href="${$ae_loc.mod.sponsorships.link}">${$ae_loc.mod.sponsorships.link}</a></p>`;
await 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: subject,
body_html: body_html,
});
$ae_sess.mod.sponsorships.submit_status = 'sending email';
}}
>
<span class="fas fa-paper-plane mx-1
"></span>
Send Email
</button>
</span>
{/if}
{#if $ae_sess.mod.sponsorships.submit_status == 'saving'}
<div class="awaiting alert_msg_pulse" out:fade={{ duration: 2000 }}>Saving...</div>
{:else if $ae_sess.mod.sponsorships.submit_status == 'saved'}