Improved styling. Less debug. Other clean up.

This commit is contained in:
Scott Idem
2024-11-12 14:13:51 -05:00
parent 1e1a4f1016
commit fedbbe9ae2
6 changed files with 63 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
/** @type {import('./$types').LayoutData} */
export let data: any;
let log_lvl = 2;
let log_lvl = 1;
console.log(`ae_idaa_recovery_meetings +layout.svelte data:`, data);
// import { browser } from '$app/environment';
@@ -21,7 +21,7 @@ import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
$slct.account_id = data.account_id;
// console.log(`$slct.account_id = `, $slct.account_id);
let ae_acct = data[$slct.account_id];
console.log(`ae_acct = `, ae_acct);
// console.log(`ae_acct = `, ae_acct);
$idaa_slct.event_obj_li = ae_acct.slct.event_obj_li;

View File

@@ -31,7 +31,7 @@ export async function load({ params, parent }) { // route
for_obj_id: account_id,
order_by_li: {'priority': 'DESC', 'sort': 'DESC', 'updated_on': 'DESC', 'created_on': 'DESC', 'name': 'ASC'},
qry_conference: false,
params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
params: {qry__enabled: 'enabled', qry__hidden: 'not_hidden', qry__limit: 25},
try_cache: true,
log_lvl: log_lvl
});

View File

@@ -1,7 +1,7 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
export let data: any;
let log_lvl = 2;
let log_lvl = 1;
// console.log(`ae_events_pres_mgmt event [event_id] +page.svelte data:`, data);
import { browser } from '$app/environment';
@@ -41,25 +41,39 @@ $: lq__event_obj = liveQuery(async () => {
$: lq_new__event_obj_li = liveQuery(async () => {
let link_to_type: string = 'account';
let link_to_id: string = $slct.account_id;
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}`);
if (log_lvl > 1) {
console.log(`link_to_type: ${link_to_type}; link_to_id: ${link_to_id}; event_id_random_li:`, event_id_random_li);
}
// Check if event_id_random_li is an array and not undefined
if (event_id_random_li) {
console.log(`Trying bulkGet:`, event_id_random_li);
if (log_lvl) {
console.log(`Trying bulkGet:`, event_id_random_li);
}
let results = await db_events.events
.bulkGet(event_id_random_li);
return results;
} else if (link_to_type && link_to_id) {
console.log(`Trying where: ${link_to_type}; equals: ${link_to_id}`);
if (log_lvl) {
console.log(`Trying where: ${link_to_type}; equals: ${link_to_id}`);
}
let results = await db_events.events
.where(`${link_to_type}_id`)
.equals(link_to_id)
.and((event) => {
return event.hide == false;
})
.and((event) => {
return event.enable == true;
})
.sortBy('name')
return results;
} else {
console.log('Trying... Nothing to load');
if (log_lvl) {
console.log('Trying... Nothing to load');
}
return null;
}
});

View File

@@ -130,7 +130,10 @@ onDestroy(() => {
URL:
</span>
<span class="ae_value">
<a href="{$lq__event_obj?.attend_url}">{$lq__event_obj?.attend_url}</a>
<a
href="{$lq__event_obj?.attend_url}"
class="text-blue-800 hover:underline"
>{$lq__event_obj?.attend_url}</a>
</span>
<span class="ae_label">
<span class="fas fa-lock"></span>
@@ -265,19 +268,23 @@ onDestroy(() => {
</span>
{$lq__event_obj?.contact_li_json[0].full_name}
{#if $lq__event_obj?.contact_li_json[0].email}
| <a href="mailto:{$lq__event_obj?.contact_li_json[0].email}?Subject={$lq__event_obj?.full_name}">{$lq__event_obj?.contact_li_json[0].email}</a>
<a
href="mailto:{$lq__event_obj?.contact_li_json[0].email}?Subject=IDAA: {$lq__event_obj?.name}"
class="text-blue-800 hover:underline"
>{$lq__event_obj?.contact_li_json[0].email}
</a>
{/if}
{#if $lq__event_obj?.contact_li_json[0].phone_mobile}
<span class="ae_label">| Mobile:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_mobile}">{$lq__event_obj?.contact_li_json[0].phone_mobile}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_mobile}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[0].phone_mobile}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[0].phone_home}
<span class="ae_label">| Home:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_home}">{$lq__event_obj?.contact_li_json[0].phone_home}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_home}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[0].phone_home}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[0].phone_office}
<span class="ae_label">| Office:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_office}">{$lq__event_obj?.contact_li_json[0].phone_office}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[0].phone_office}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[0].phone_office}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[0].other_text}| {$lq__event_obj?.contact_li_json[0].other_text}{/if}
</div>
@@ -292,19 +299,23 @@ onDestroy(() => {
</span>
{$lq__event_obj?.contact_li_json[1].full_name}
{#if $lq__event_obj?.contact_li_json[1].email}
| <a href="mailto:{$lq__event_obj?.contact_li_json[1].email}?Subject={$lq__event_obj?.full_name}">{$lq__event_obj?.contact_li_json[1].email}</a>
| <a
href="mailto:{$lq__event_obj?.contact_li_json[1].email}?Subject=IDAA: {$lq__event_obj?.name}"
class="text-blue-800 hover:underline"
>{$lq__event_obj?.contact_li_json[1].email}
</a>
{/if}
{#if $lq__event_obj?.contact_li_json[1].phone_mobile}
<span class="ae_label">| Mobile:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_mobile}">{$lq__event_obj?.contact_li_json[1].phone_mobile}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_mobile}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[1].phone_mobile}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[1].phone_home}
<span class="ae_label">| Home:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_home}">{$lq__event_obj?.contact_li_json[1].phone_home}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_home}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[1].phone_home}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[1].phone_office}
<span class="ae_label">| Office:</span>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_office}">{$lq__event_obj?.contact_li_json[1].phone_office}</a>
<a href="tel:{$lq__event_obj?.contact_li_json[1].phone_office}" class="text-blue-800 hover:underline">{$lq__event_obj?.contact_li_json[1].phone_office}</a>
{/if}
{#if $lq__event_obj?.contact_li_json[1].other_text}| {$lq__event_obj?.contact_li_json[1].other_text}{/if}
</div>

View File

@@ -39,6 +39,7 @@ onMount(() => {
{#each $lq__event_obj_li as idaa_event_obj, index}
<div
class="container recovery_meeting event_obj border border-1 rounded p-2 mb-2"
class:hidden={(idaa_event_obj?.hide || !idaa_event_obj?.enable) && !$ae_loc.trusted_access}
class:dim={idaa_event_obj?.hide}
class:bg-warning-100={!idaa_event_obj?.enable}
class:text-warning-900={!idaa_event_obj?.enable}
@@ -172,7 +173,7 @@ onMount(() => {
<!-- <span class="ae_label">Timezone:</span> -->
(<span class="ae_value">{idaa_event_obj?.timezone}</span>)
{:else}
<div class="event__tiemzone ae_warning">Required: No timezone was given!</div>
<div class="event__tiemzone ae_warning bg-warning-100">Required: No timezone was given!</div>
{/if}
</div>
@@ -187,25 +188,29 @@ onMount(() => {
</span>
{idaa_event_obj?.contact_li_json[0].full_name}
{#if idaa_event_obj?.contact_li_json[0].email}
| <a href="mailto:{idaa_event_obj?.contact_li_json[0].email}?Subject={idaa_event_obj?.full_name}">{idaa_event_obj?.contact_li_json[0].email}</a>
| <a
href="mailto:{idaa_event_obj?.contact_li_json[0].email}?Subject=IDAA: {idaa_event_obj?.name}"
class="text-blue-800 hover:underline"
>{idaa_event_obj?.contact_li_json[0].email}
</a>
{/if}
{#if idaa_event_obj?.contact_li_json[0].phone_mobile}
<span class="ae_label">| Mobile:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_mobile}">{idaa_event_obj?.contact_li_json[0].phone_mobile}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_mobile}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[0].phone_mobile}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[0].phone_home}
<span class="ae_label">| Home:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_home}">{idaa_event_obj?.contact_li_json[0].phone_home}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_home}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[0].phone_home}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[0].phone_office}
<span class="ae_label">| Office:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_office}">{idaa_event_obj?.contact_li_json[0].phone_office}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[0].phone_office}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[0].phone_office}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[0].other_text}| {idaa_event_obj?.contact_li_json[0].other_text}{/if}
</div>
{:else}
{#if $ae_loc.trusted_access}
<div class="event__contact ae_warning">
<div class="event__contact ae_warning bg-warning-100">
ALERT: The primary contact information may be missing? This meeting should be checked and updated. Please Edit and Save to use the new format.
<!-- This must be done by March 1, 2024. -->
</div>
@@ -221,21 +226,25 @@ onMount(() => {
</span>
{idaa_event_obj?.contact_li_json[1].full_name}
{#if idaa_event_obj?.contact_li_json[1].email}
| <a href="mailto:{idaa_event_obj?.contact_li_json[1].email}?Subject={idaa_event_obj?.full_name}">{idaa_event_obj?.contact_li_json[1].email}</a>
| <a
href="mailto:{idaa_event_obj?.contact_li_json[1].email}?Subject=IDAA: {idaa_event_obj?.name}"
class="text-blue-800 hover:underline"
>{idaa_event_obj?.contact_li_json[1].email}
</a>
{/if}
{#if idaa_event_obj?.contact_li_json[1].phone_mobile}
<span class="ae_label">| Mobile:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_mobile}">{idaa_event_obj?.contact_li_json[1].phone_mobile}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_mobile}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[1].phone_mobile}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[1].phone_home}
<span class="ae_label">| Home:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_home}">{idaa_event_obj?.contact_li_json[1].phone_home}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_home}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[1].phone_home}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[1].phone_office}
<span class="ae_label">| Office:</span>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_office}">{idaa_event_obj?.contact_li_json[1].phone_office}</a>
<a href="tel:{idaa_event_obj?.contact_li_json[1].phone_office}" class="text-blue-800 hover:underline">{idaa_event_obj?.contact_li_json[1].phone_office}</a>
{/if}
{#if idaa_event_obj?.contact_li_json[0].other_text}| {idaa_event_obj?.contact_li_json[0].other_text}{/if}
{#if idaa_event_obj?.contact_li_json[1].other_text}| {idaa_event_obj?.contact_li_json[1].other_text}{/if}
</div>
{/if}
{#if $ae_loc.trusted_access}

View File

@@ -10,7 +10,7 @@ import { core_func } from '$lib/ae_core/ae_core_functions';
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
import { events_func } from '$lib/ae_events_functions';
export let log_lvl = 1;
export let log_lvl = 0;
export let event_id_random_li: Array<string>;
// export let container_class_li = [];