More clean up. Probably wrapping up for the day. Why are so many people so dumb, or they just don't seem to care.

This commit is contained in:
Scott Idem
2024-11-06 17:08:39 -05:00
parent 7e6b00c0eb
commit b381cbbc9e
4 changed files with 89 additions and 122 deletions

View File

@@ -113,13 +113,21 @@ $: lq__post_comment_obj = liveQuery(async () => {
// url.searchParams.set('post_id', $lq__post_obj?.post_id_random);
// history.pushState({}, '', url);
$idaa_sess.bb.show__modal_view = false;
$idaa_sess.bb.show__inline_edit__post_obj = true;
// $idaa_sess.bb.show__modal_view = false;
if ($idaa_sess.bb.show__inline_edit__post_obj) {
$idaa_sess.bb.show__inline_edit__post_obj = false;
} else {
$idaa_sess.bb.show__inline_edit__post_obj = true;
}
}}
class="btn btn-sm variant-ghost-warning hover:variant-filled-warning transition"
title={`Edit meeting: ${$lq__post_obj?.title}`}
>
<span class="fas fa-edit m-1"></span> Edit
{#if $idaa_sess.bb.show__inline_edit__post_obj}
<span class="fas fa-times m-1"></span> Cancel Edit
{:else}
<span class="fas fa-edit m-1"></span> Edit
{/if}
</button>
{/if}
{$lq__post_obj?.title}

View File

@@ -3,6 +3,7 @@ export let log_lvl = 1;
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import { fade } from 'svelte/transition';
import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { core_func } from '$lib/ae_core/ae_core_functions';
import { api } from '$lib/api';
@@ -13,12 +14,6 @@ import Tiptap_editor from '$lib/element_tiptap_editor.svelte';
export let lq__post_comment_obj: any;
const dispatch = createEventDispatcher();
type key_val = {
[key: string]: any;
};
let prom_api__post_comment_obj: any;
let disable_submit_btn = true;
@@ -77,7 +72,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
</button>
</section> <!-- END: section post__options -->
<h3 class="h3">Post Comment</h3>
<!-- <h3 class="h3">Post Comment</h3> -->
<input type="hidden" value={$idaa_slct.post_id} />
@@ -87,40 +82,18 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
<input type="text" id="title" name="title" required max="200" value={$lq__post_comment_obj?.title} placeholder="Title of Post" autocomplete="off" class="input w-96" />
</label> -->
<label for="description" class="ae_label post__description">Content (comment body):
<label for="content" class="ae_label post__content">Content (comment body):
<Tiptap_editor
default_minimal={true}
bind:html_text={$idaa_slct.post_comment_obj.description}
bind:html_text={$idaa_slct.post_comment_obj.content}
show_button_kv={{'heading__h1': false, 'heading__h2': false, 'heading__h3': false}}
bind:new_html={$idaa_slct.post_comment_obj.description_new_html}
bind:new_html={$idaa_slct.post_comment_obj.content_new_html}
placeholder="Your post content here..."
/>
</label>
<div>
<label class="">
BB post topic:
<select
name="type"
class="select w-96"
value={$lq__post_comment_obj?.type}
>
<option value="">-- None --</option>
<option value={16}>Licensing/ monitoring/ credentialing issues</option>
<option value={17}>Return to practice</option>
<option value={18}>Contacts/ sponsorship in my area</option>
<option value={19}>Professional positions</option>
<option value={21}
disabled={!$ae_loc.trusted_access}
>
Announcement
</option>
</select>
</label>
</div>
<h3 class="h3">Poster's Information</h3>
<fieldset class="">
@@ -131,7 +104,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
id="anonymous_no"
name="anonymous"
value={false}
bind:group={$slct.post_comment_obj.anonymous}
bind:group={$idaa_slct.post_comment_obj.anonymous}
class="radio"
>
<label for="anonymous_no">No, include my name and email address</label>
@@ -142,7 +115,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
id="anonymous_yes"
name="anonymous"
value={true}
bind:group={$slct.post_comment_obj.anonymous}
bind:group={$idaa_slct.post_comment_obj.anonymous}
class="radio"
>
<label for="anonymous_yes">Yes, the post will be listed as Anonymous</label>
@@ -156,7 +129,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
type="text"
id="external_person_id"
name="external_person_id"
value={($slct.post_comment_obj.external_person_id ? $slct.post_comment_obj.external_person_id : $idaa_loc.novi_uuid)}
value={($idaa_slct.post_comment_obj.external_person_id ? $idaa_slct.post_comment_obj.external_person_id : $idaa_loc.novi_uuid)}
readonly={true}
class="input w-96"
>
@@ -169,7 +142,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
type="text"
id="external_person_id"
name="external_person_id"
value={($slct.post_comment_obj.external_person_id ? $slct.post_comment_obj.external_person_id : '')}
value={($idaa_slct.post_comment_obj.external_person_id ? $idaa_slct.post_comment_obj.external_person_id : '')}
readonly={false}
class="input w-96"
>
@@ -186,7 +159,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
type="text"
id="full_name"
name="full_name"
value={($slct.post_comment_obj.full_name ? $slct.post_comment_obj.full_name : $idaa_loc.novi_full_name)}
value={($idaa_slct.post_comment_obj.full_name ? $idaa_slct.post_comment_obj.full_name : $idaa_loc.novi_full_name)}
readonly={!$ae_loc.trusted_access}
class="input w-96"
>
@@ -202,7 +175,7 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
<input
type="text"
name="email"
value={($slct.post_comment_obj.email ? $slct.post_comment_obj.email : $idaa_loc.novi_email)}
value={($idaa_slct.post_comment_obj.email ? $idaa_slct.post_comment_obj.email : $idaa_loc.novi_email)}
readonly={!$ae_loc.trusted_access}
class="input w-96"
>
@@ -212,89 +185,84 @@ async function handle_delete_post_comment_obj({post_id, method}: key_val) {
</section> <!-- END: section post__general_information -->
{#if $ae_loc.trusted_access}
<button
type="button"
class="ae_btn ae_d_none_toggle ae_float_right ae_smallest btn btn-xs btn-info btn-sm variant-ghost-warning hover:variant-filled-warning transition"
class="btn btn-sm variant-soft-secondary float-right"
on:click={() => {
// document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_out'); document.querySelector('.ae_d_none_content').classList.toggle('ae_fade_in');
$idaa_loc.show__admin_options = !$idaa_loc.show__admin_options;
$idaa_loc.bb.show__admin_options = !$idaa_loc.bb.show__admin_options;
}}
>
<span class="fas fa-eye m-1"></span>
{$idaa_loc.show__admin_options ? 'Hide' : ''} Admin Options?
{$idaa_loc.bb.show__admin_options ? 'Hide' : 'Show'} Admin
</button>
<section
class="ae_section post__admin_options"
class:hidden={!$ae_loc.trusted_access || !$idaa_loc.show__admin_options}
class="ae_section post__admin_options border border-gray-200 rounded p-2 space-y-2"
class:hidden={!$idaa_loc.bb.show__admin_options}
> <!-- BEGIN: section post__admin_options -->
<h3 class="h4">
<h3 class="h3">
Admin Options
</h3>
<span
class="flex flex-row flex-wrap items-center justify-between"
>
<label>Hide
<input
type="checkbox"
name="hide"
id="hide"
bind:checked={$idaa_slct.post_comment_obj.hide}
class="checkbox"
>
</label>
<span
class="flex flex-row flex-wrap items-center justify-between"
>
<label>Hide
<input
type="checkbox"
name="hide"
id="hide"
bind:checked={$idaa_slct.post_comment_obj.hide}
class="checkbox"
>
</label>
<label>Priority
<input
type="checkbox"
name="priority"
id="priority"
bind:checked={$idaa_slct.post_comment_obj.priority}
class="checkbox"
>
</label>
<label>Priority
<input
type="checkbox"
name="priority"
id="priority"
bind:checked={$idaa_slct.post_comment_obj.priority}
class="checkbox"
>
</label>
<label>Sort <input type="number" name="sort" value={$lq__post_comment_obj?.sort} class="input w-24" /></label>
<label>Sort <input type="number" name="sort" value={$lq__post_comment_obj?.sort} class="input w-24" /></label>
<label>Group <input type="text" name="group" value={$lq__post_comment_obj?.group ? $lq__post_comment_obj?.group : ''} max="100" class="input w-40" /></label>
<label>Group <input type="text" name="group" value={$lq__post_comment_obj?.group ? $lq__post_comment_obj?.group : ''} max="100" class="input w-40" /></label>
{#if $ae_loc.administrator_access}
<label>Enable
<input
type="checkbox"
name="enable"
id="enable"
bind:checked={$idaa_slct.post_comment_obj.enable}
class="checkbox"
>
</label>
{/if}
</span>
{#if $ae_loc.trusted_access}
<label
for="notes"
>
Internal Staff Notes
<Tiptap_editor
default_minimal={true}
bind:html_text={$idaa_slct.post_comment_obj.notes}
show_button_kv={{'heading__h1': false, 'heading__h2': false, 'heading__h3': false}}
bind:new_html={$idaa_slct.post_comment_obj.notes_new_html}
/>
{#if $ae_loc.administrator_access}
<label>Enable
<input
type="checkbox"
name="enable"
id="enable"
bind:checked={$idaa_slct.post_comment_obj.enable}
class="checkbox"
>
</label>
{/if}
</span>
</span> <!-- END: span ae_show_hide_content -->
{#if $ae_loc.trusted_access}
<label
for="notes"
>
Internal Staff Notes
<Tiptap_editor
default_minimal={true}
bind:html_text={$idaa_slct.post_comment_obj.notes}
show_button_kv={{'heading__h1': false, 'heading__h2': false, 'heading__h3': false}}
bind:new_html={$idaa_slct.post_comment_obj.notes_new_html}
/>
</label>
{/if}
</section> <!-- END: section post__admin_options -->
{/if}
<section class="ae_section ae_options ae_row ae_actions post__options post__actions flex flex-row gap-1 items-center justify-between">

View File

@@ -3,6 +3,7 @@ export let log_lvl = 1;
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
import { fade } from 'svelte/transition';
import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { core_func } from '$lib/ae_core/ae_core_functions';
import { api } from '$lib/api';
@@ -13,12 +14,6 @@ import Tiptap_editor from '$lib/element_tiptap_editor.svelte';
export let lq__post_obj: any;
const dispatch = createEventDispatcher();
type key_val = {
[key: string]: any;
};
let prom_api__post_obj: any;
let disable_submit_btn = true;
@@ -87,14 +82,14 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
<input type="text" id="title" name="title" required max="200" value={$lq__post_obj?.title} placeholder="Title of Post" autocomplete="off" class="input w-96" />
</label>
<label for="description" class="ae_label post__description">Content (post body):
<!-- <textarea name="description" id="description" class="ae_value post__description tinymce_editor editor_basic textarea" rows="5" cols="70" bind:value={$idaa_slct.post_obj.description} ></textarea> -->
<label for="content" class="ae_label post__content">Content (post body):
<!-- <textarea name="content" id="content" class="ae_value post__content tinymce_editor editor_basic textarea" rows="5" cols="70" bind:value={$idaa_slct.post_obj.content} ></textarea> -->
<Tiptap_editor
default_minimal={true}
bind:html_text={$idaa_slct.post_obj.description}
bind:html_text={$idaa_slct.post_obj.content}
show_button_kv={{'heading__h1': false, 'heading__h2': false, 'heading__h3': false}}
bind:new_html={$idaa_slct.post_obj.description_new_html}
bind:new_html={$idaa_slct.post_obj.content_new_html}
placeholder="Your post content here..."
/>
@@ -113,9 +108,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
<option value={17}>Return to practice</option>
<option value={18}>Contacts/ sponsorship in my area</option>
<option value={19}>Professional positions</option>
<option value={21}
disabled={!$ae_loc.trusted_access}
>
<option value={21} disabled={!$ae_loc.trusted_access}>
Announcement
</option>
</select>
@@ -132,7 +125,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
id="anonymous_no"
name="anonymous"
value={false}
bind:group={$slct.post_obj.anonymous}
bind:group={$idaa_slct.post_obj.anonymous}
class="radio"
>
<label for="anonymous_no">No, include my name and email address</label>
@@ -143,7 +136,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
id="anonymous_yes"
name="anonymous"
value={true}
bind:group={$slct.post_obj.anonymous}
bind:group={$idaa_slct.post_obj.anonymous}
class="radio"
>
<label for="anonymous_yes">Yes, the post will be listed as Anonymous</label>
@@ -157,7 +150,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
type="text"
id="external_person_id"
name="external_person_id"
value={($slct.post_obj.external_person_id ? $slct.post_obj.external_person_id : $idaa_loc.novi_uuid)}
value={($idaa_slct.post_obj.external_person_id ? $idaa_slct.post_obj.external_person_id : $idaa_loc.novi_uuid)}
readonly={true}
class="input w-96"
>
@@ -170,7 +163,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
type="text"
id="external_person_id"
name="external_person_id"
value={($slct.post_obj.external_person_id ? $slct.post_obj.external_person_id : '')}
value={($idaa_slct.post_obj.external_person_id ? $idaa_slct.post_obj.external_person_id : '')}
readonly={false}
class="input w-96"
>
@@ -187,7 +180,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
type="text"
id="full_name"
name="full_name"
value={($slct.post_obj.full_name ? $slct.post_obj.full_name : $idaa_loc.novi_full_name)}
value={($idaa_slct.post_obj.full_name ? $idaa_slct.post_obj.full_name : $idaa_loc.novi_full_name)}
readonly={!$ae_loc.trusted_access}
class="input w-96"
>
@@ -203,7 +196,7 @@ async function handle_delete_post_obj({post_id, method}: key_val) {
<input
type="text"
name="email"
value={($slct.post_obj.email ? $slct.post_obj.email : $idaa_loc.novi_email)}
value={($idaa_slct.post_obj.email ? $idaa_slct.post_obj.email : $idaa_loc.novi_email)}
readonly={!$ae_loc.trusted_access}
class="input w-96"
>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { createEventDispatcher, onMount } from 'svelte';
import { onMount } from 'svelte';
import { fade } from 'svelte/transition';
import { Modal } from 'flowbite-svelte';
@@ -17,8 +17,6 @@ export let lq__post_comment_obj: any;
// import Edit_post_comment_obj from './10_edit__post_comment_obj.svelte';
const dispatch = createEventDispatcher();
if ($idaa_slct.post_id) {
console.log(`Post ID selected: ${$idaa_slct.post_id}`);
console.log(`Post Object selected: ${$lq__post_obj}`);
@@ -218,7 +216,7 @@ function handle_post_comment_obj_deleted(event) {
{#if $ae_loc.trusted_access || post_comment_obj.external_person_id === $idaa_loc.novi_uuid}
<div class="ae_options">
<button on:click={() => {
$idaa_slct.post_comment_id = post_comment_obj.post_comment_id_random;
$idaa_slct.post_comment_id = post_comment_obj.post_comment_id;
$idaa_slct.post_comment_obj = post_comment_obj;
$idaa_sess.bb.show__inline_edit__post_comment_id = post_comment_obj.post_comment_id;