Starting real work on the IDAA BB (posts). Can at least view them and their comments now.

This commit is contained in:
Scott Idem
2024-11-05 12:37:46 -05:00
parent 4d2a78f80f
commit ac7016bb3e
19 changed files with 679 additions and 655 deletions

View File

@@ -24,60 +24,60 @@ import View_archive_obj from './10_view__archive_obj.svelte';
// *** Export/Exposed variables and functions for component
// export let account_id: string = $page['page_for']['account_id'];
export let account_id: string = $ae_app.account_id;
export let archive_id: string = $ae_app.archives.archive_id;
export let archive_id: string = $idaa_loc.archives.archive_id;
export let novi_uuid: string = $ae_app.novi_uuid;
export let novi_email: string = $ae_app.novi_email;
export let novi_full_name: string = $ae_app.novi_full_name;
export let novi_admin_li: string = $ae_app.novi_admin_li;
export let novi_trusted_li: string = $ae_app.novi_trusted_li;
export let novi_uuid: string = $idaa_loc.novi_uuid;
export let novi_email: string = $idaa_loc.novi_email;
export let novi_full_name: string = $idaa_loc.novi_full_name;
export let novi_admin_li: string = $idaa_loc.novi_admin_li;
export let novi_trusted_li: string = $idaa_loc.novi_trusted_li;
// *** Set initial variables
$ae_app.novi_uuid = novi_uuid;
$ae_app.novi_email = decodeURIComponent(novi_email);
$ae_app.novi_full_name = decodeURIComponent(novi_full_name);
$ae_app.novi_admin_li = novi_admin_li;
$ae_app.novi_trusted_li = novi_trusted_li;
$idaa_loc.novi_uuid = novi_uuid;
$idaa_loc.novi_email = decodeURIComponent(novi_email);
$idaa_loc.novi_full_name = decodeURIComponent(novi_full_name);
$idaa_loc.novi_admin_li = novi_admin_li;
$idaa_loc.novi_trusted_li = novi_trusted_li;
$ae_app.current_timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
if (!$ae_app.lu_timezone_list) {
$ae_app.lu_timezone_list = [];
}
$ae_app.archives.show_main__options = true; // Section for: buttons for creating new archives, show/hide archives, and search archives
// $ae_app.archives.show_list__archive_obj_li = true;
// $ae_app.archives.show_view__archive_obj = $ae_app.archives.show_view__archive_obj;
$ae_app.archives.fulltext_search_qry_str = '';
$ae_app.archives.qry_type = false
$idaa_loc.archives.show_main__options = true; // Section for: buttons for creating new archives, show/hide archives, and search archives
// $idaa_loc.archives.show_list__archive_obj_li = true;
// $idaa_loc.archives.show_view__archive_obj = $idaa_loc.archives.show_view__archive_obj;
$idaa_loc.archives.fulltext_search_qry_str = '';
$idaa_loc.archives.qry_type = false
// NOTE: Check if the novi_uuid is in the novi_admin_li list
if ($ae_app.novi_uuid && $ae_app.novi_admin_li) {
if ($ae_app.novi_admin_li.includes($ae_app.novi_uuid)) {
$ae_app.access_type = 'administrator';
$ae_app.administrator_access = true;
$ae_app.trusted_access = true;
if ($idaa_loc.novi_uuid && $idaa_loc.novi_admin_li) {
if ($idaa_loc.novi_admin_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'administrator';
$ae_loc.administrator_access = true;
$ae_loc.trusted_access = true;
}
}
// NOTE: Check if the novi_uuid is in the novi_trusted_li list
if ($ae_app.novi_uuid && $ae_app.novi_trusted_li) {
if ($ae_app.novi_trusted_li.includes($ae_app.novi_uuid)) {
$ae_app.access_type = 'trusted';
$ae_app.trusted_access = true;
if ($idaa_loc.novi_uuid && $idaa_loc.novi_trusted_li) {
if ($idaa_loc.novi_trusted_li.includes($idaa_loc.novi_uuid)) {
$ae_loc.access_type = 'trusted';
$ae_loc.trusted_access = true;
}
}
if ($ae_app.administrator_access) {
$ae_app.archives.enabled = 'enabled';
$ae_app.archives.hidden = 'not_hidden';
$ae_app.archives.limit = 150;
} else if ($ae_app.trusted_access) {
$ae_app.archives.enabled = 'enabled';
$ae_app.archives.hidden = 'not_hidden';
$ae_app.archives.limit = 75;
if ($ae_loc.administrator_access) {
$idaa_loc.archives.enabled = 'enabled';
$idaa_loc.archives.hidden = 'not_hidden';
$idaa_loc.archives.limit = 150;
} else if ($ae_loc.trusted_access) {
$idaa_loc.archives.enabled = 'enabled';
$idaa_loc.archives.hidden = 'not_hidden';
$idaa_loc.archives.limit = 75;
} else {
$ae_app.archives.enabled = 'enabled';
$ae_app.archives.hidden = 'not_hidden';
$ae_app.archives.limit = 75;
$idaa_loc.archives.enabled = 'enabled';
$idaa_loc.archives.hidden = 'not_hidden';
$idaa_loc.archives.limit = 75;
}
let idaa_archive_obj_li_get_promise;
@@ -93,15 +93,15 @@ if (archive_id) {
$slct.archive_id = archive_id;
$slct_trigger = 'load__archive_obj';
// $ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_obj = false;
} else {
// $ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = false;
}
if (!$ae_app.client_content) {
@@ -161,10 +161,10 @@ $: if ($slct_trigger == 'load__archive_obj' && $slct.archive_id) {
let message = {'archive_id': $slct.archive_id};
window.parent.postMessage(message, "*");
// $ae_app.archives.show_main__options = false;
// $ae_app.archives.show_list__archive_obj_li = false;
// $ae_app.archives.show_view__archive_obj = true;
// $ae_app.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_main__options = false;
// $idaa_loc.archives.show_list__archive_obj_li = false;
// $idaa_loc.archives.show_view__archive_obj = true;
// $idaa_loc.archives.show_edit__archive_obj = false;
}
$: if ($slct_trigger == 'load__archive_obj_li' && $slct.account_id) {
@@ -176,27 +176,27 @@ $: if ($slct_trigger == 'load__archive_obj_li' && $slct.account_id) {
async function handle_load_archive_obj_li({account_id, try_cache=true}) {
console.log('*** handle_load_archive_obj_li() ***');
console.log($ae_app.archives);
console.log($idaa_loc.archives);
let enabled = $ae_app.archives.enabled;
let hidden = $ae_app.archives.hidden;
let limit = $ae_app.archives.limit;
let offset = $ae_app.archives.offset;
let enabled = $idaa_loc.archives.enabled;
let hidden = $idaa_loc.archives.hidden;
let limit = $idaa_loc.archives.limit;
let offset = $idaa_loc.archives.offset;
let params = {};
let params_json: key_val = {};
if ($ae_app.archives.fulltext_search_qry_str && $ae_app.archives.fulltext_search_qry_str.length > 2) {
if ($idaa_loc.archives.fulltext_search_qry_str && $idaa_loc.archives.fulltext_search_qry_str.length > 2) {
params_json['ft_qry'] = {
'default_qry_str': $ae_app.archives.fulltext_search_qry_str,
'default_qry_str': $idaa_loc.archives.fulltext_search_qry_str,
};
}
if ($ae_app.archives.qry_audio || $ae_app.archives.qry_video || $ae_app.archives.qry_other) {
if ($idaa_loc.archives.qry_audio || $idaa_loc.archives.qry_video || $idaa_loc.archives.qry_other) {
params_json['and_qry'] = {};
if ($ae_app.archives.qry_audio) params_json['and_qry']['audio'] = true;
if ($ae_app.archives.qry_video) params_json['and_qry']['video'] = true;
if ($ae_app.archives.qry_other) params_json['and_qry']['other'] = $ae_app.archives.qry_other;
if ($idaa_loc.archives.qry_audio) params_json['and_qry']['audio'] = true;
if ($idaa_loc.archives.qry_video) params_json['and_qry']['video'] = true;
if ($idaa_loc.archives.qry_other) params_json['and_qry']['other'] = $idaa_loc.archives.qry_other;
}
console.log('params_json:', params_json);
@@ -237,10 +237,10 @@ async function handle_load_archive_obj_li({account_id, try_cache=true}) {
async function handle_load_archive_obj({archive_id, try_cache=false}) {
console.log('*** handle_load_archive_obj() ***');
// let enabled = $ae_app.archives.enabled;
// let hidden = $ae_app.archives.hidden;
// let limit = $ae_app.archives.limit;
// let offset = $ae_app.archives.offset;
// let enabled = $idaa_loc.archives.enabled;
// let hidden = $idaa_loc.archives.hidden;
// let limit = $idaa_loc.archives.limit;
// let offset = $idaa_loc.archives.offset;
let params = {};
@@ -257,7 +257,7 @@ async function handle_load_archive_obj({archive_id, try_cache=false}) {
if (archive_obj_get_result) {
$slct.archive_obj = archive_obj_get_result;
// console.log($slct.archive_obj.cfg_json.content_group_sort);
$ae_app.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
$idaa_loc.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
console.log(`Archive object:`, $slct.archive_obj);
}
})
@@ -284,10 +284,10 @@ function handle_created_archive_obj(event) {
// $slct_trigger = 'load__archive_obj';
$slct_trigger = 'load__archive_obj_li';
// $ae_app.archives.show_main__options = false;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_main__options = false;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_obj = false;
}
function handle_updated_archive_obj(event) {
@@ -298,10 +298,10 @@ function handle_updated_archive_obj(event) {
// NOTE: If the next trigger is set too quickly it will cause the one above to be missed.
// $slct_trigger = 'load__archive_obj_li';
// $ae_app.archives.show_main__options = false;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_main__options = false;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_obj = false;
}
function handle_deleted_archive_obj(event) {
@@ -317,10 +317,10 @@ function handle_deleted_archive_obj(event) {
$slct_trigger = 'load__archive_obj_li';
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = false;
}
</script>
@@ -332,23 +332,23 @@ function handle_deleted_archive_obj(event) {
<section class="ae_section ae_meta">
<p>
Novi: {$ae_app.novi_full_name}
Novi: {$idaa_loc.novi_full_name}
<span class="details">
(
{$ae_app.novi_email}
{#if $ae_app.administrator_access}
{$idaa_loc.novi_email}
{#if $ae_loc.administrator_access}
<span class="access_type administrator_access">Administrator</span>
{:else if $ae_app.trusted_access}
{:else if $ae_loc.trusted_access}
<span class="access_type trusted_access">Trusted</span>
{/if}
<span class="novi_uuid">UUID: {$ae_app.novi_uuid}</span>
<span class="novi_uuid">UUID: {$idaa_loc.novi_uuid}</span>
)
</span>
</p>
<!-- <p>Page height: {window.innerHeight}</p> -->
</section>
{#if $ae_app.archives.show_main__options}
{#if $idaa_loc.archives.show_main__options}
<section class="ae_section ae_options ae_column archive_obj__options">
<!-- <div class="note">A comment about the IDAA archives in general can go here.</div> -->
@@ -357,12 +357,12 @@ function handle_deleted_archive_obj(event) {
<!-- Show/hide hidden content -->
{#if $ae_app.trusted_access}
{#if $ae_app.archives.hidden == 'not_hidden'}
{#if $ae_loc.trusted_access}
{#if $idaa_loc.archives.hidden == 'not_hidden'}
<button
on:click={() => {
$ae_app.archives.hidden = 'all';
$ae_app.archives.limit = 150;
$idaa_loc.archives.hidden = 'all';
$idaa_loc.archives.limit = 150;
$slct_trigger = 'load__archive_obj_li';
}}
class="btn_new_bb_post ae_btn btn_xs ae_smallest btn btn-xs btn-info"
@@ -372,7 +372,7 @@ function handle_deleted_archive_obj(event) {
{:else}
<button
on:click={() => {
$ae_app.archives.hidden = 'not_hidden';
$idaa_loc.archives.hidden = 'not_hidden';
$slct_trigger = 'load__archive_obj_li';
}}
class="btn_new_bb_post ae_btn btn_xs btn btn-xs btn-info"
@@ -382,12 +382,12 @@ function handle_deleted_archive_obj(event) {
{/if}
<!-- We only want these options to show if a specific archive is showing. -->
{#if $ae_app.archives.show_view__archive_obj}
{#if $ae_app.archives.hidden == 'not_hidden'}
{#if $idaa_loc.archives.show_view__archive_obj}
{#if $idaa_loc.archives.hidden == 'not_hidden'}
<button
on:click={() => {
$ae_app.archives.hidden = 'all';
$ae_app.archives.limit = 150;
$idaa_loc.archives.hidden = 'all';
$idaa_loc.archives.limit = 150;
$slct_trigger = 'load__archive_content_obj_li';
}}
class="btn_new_bb_post ae_btn btn_xs ae_smallest btn btn-xs btn-info"
@@ -397,7 +397,7 @@ function handle_deleted_archive_obj(event) {
{:else}
<button
on:click={() => {
$ae_app.archives.hidden = 'not_hidden';
$idaa_loc.archives.hidden = 'not_hidden';
$slct_trigger = 'load__archive_content_obj_li';
}}
class="btn_new_bb_post ae_btn btn_xs btn btn-xs btn-info"
@@ -410,13 +410,13 @@ function handle_deleted_archive_obj(event) {
<!-- For administrator access: Show/hide disabled content -->
{#if $ae_app.administrator_access}
{#if $ae_app.archives.enabled == 'enabled'}
{#if $ae_loc.administrator_access}
{#if $idaa_loc.archives.enabled == 'enabled'}
<button
on:click={() => {
$ae_app.archives.hidden = 'all';
$ae_app.archives.enabled = 'all';
$ae_app.archives.limit = 500;
$idaa_loc.archives.hidden = 'all';
$idaa_loc.archives.enabled = 'all';
$idaa_loc.archives.limit = 500;
$slct_trigger = 'load__archive_obj_li';
}}
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
@@ -426,7 +426,7 @@ function handle_deleted_archive_obj(event) {
{:else}
<button
on:click={() => {
$ae_app.archives.enabled = 'enabled';
$idaa_loc.archives.enabled = 'enabled';
$slct_trigger = 'load__archive_obj_li';
}}
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
@@ -435,12 +435,12 @@ function handle_deleted_archive_obj(event) {
</button>
{/if}
{#if $ae_app.archives.enabled == 'enabled'}
{#if $idaa_loc.archives.enabled == 'enabled'}
<button
on:click={() => {
$ae_app.archives.hidden = 'all';
$ae_app.archives.enabled = 'all';
$ae_app.archives.limit = 500;
$idaa_loc.archives.hidden = 'all';
$idaa_loc.archives.enabled = 'all';
$idaa_loc.archives.limit = 500;
$slct_trigger = 'load__archive_content_obj_li';
}}
class="ae_btn btn_xs ae_smallest btn btn-xs btn-warning"
@@ -450,7 +450,7 @@ function handle_deleted_archive_obj(event) {
{:else}
<button
on:click={() => {
$ae_app.archives.enabled = 'enabled';
$idaa_loc.archives.enabled = 'enabled';
$slct_trigger = 'load__archive_content_obj_li';
}}
class="ae_btn btn_xs btn btn-xs btn-warning"
@@ -470,10 +470,10 @@ function handle_deleted_archive_obj(event) {
$slct.archive_id = null;
$slct.archive_obj = {};
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = false;
// $ae_app.iframe_height_modal_body = 0;
const url = new URL(location);
@@ -488,7 +488,7 @@ function handle_deleted_archive_obj(event) {
<span class="fas fa-times"></span> View Other Archives
</button>
{/if}
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<button
on:click={() => {
$slct.archive_id = null;
@@ -498,10 +498,10 @@ function handle_deleted_archive_obj(event) {
url.searchParams.delete('archive_id');
history.pushState({}, '', url);
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = true;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = true;
}}
class="ae_btn ae_smallest btn_new_archive ae_btn btn btn-warning"
>
@@ -514,7 +514,7 @@ function handle_deleted_archive_obj(event) {
{/if}
{#if $ae_app.archives.show_list__archive_obj_li}
{#if $idaa_loc.archives.show_list__archive_obj_li}
<List_archive_obj
on:created__archive_obj={handle_created_archive_obj}
on:updated__archive_obj={handle_updated_archive_obj}
@@ -523,7 +523,7 @@ function handle_deleted_archive_obj(event) {
{/if}
{#if $ae_app.archives.show_view__archive_obj && $slct.archive_obj}
{#if $idaa_loc.archives.show_view__archive_obj && $slct.archive_obj}
<View_archive_obj />
{/if}
@@ -531,16 +531,16 @@ function handle_deleted_archive_obj(event) {
</section>
{#if $ae_app.archives.show_edit__archive_obj}
{#if $idaa_loc.archives.show_edit__archive_obj}
<Element_modal_v3
show = { true }
modal_cover_body = { false }
report_client_dimensions = { true }
on:close={ () => {
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_edit__archive_obj = false;
$ae_app.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_view__archive_obj = false;
const url = new URL(location);
url.searchParams.delete('archive_id');
@@ -571,7 +571,7 @@ function handle_deleted_archive_obj(event) {
{/if}
<!-- {#if $ae_app.archives.show_view__archive_obj && $slct.archive_obj}
<!-- {#if $idaa_loc.archives.show_view__archive_obj && $slct.archive_obj}
<Element_modal_v3
show = { true }
modal_cover_body = { true }
@@ -581,10 +581,10 @@ function handle_deleted_archive_obj(event) {
$slct.archive_id = null;
$slct.archive_obj = {};
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = false;
$ae_app.iframe_height_modal_body = 0;
const url = new URL(location);

View File

@@ -11,7 +11,7 @@ type key_val = {
[key: string]: any;
};
$ae_app.archives.input_file_list = []
$idaa_loc.archives.input_file_list = []
let create_archive_content_obj_promise: any;
let delete_archive_content_obj_promise: any;
@@ -315,14 +315,14 @@ function handle_input_file_list_updated(event) {
// This now needs be reviewed and possibly updated with additional information. Check if any files have already been uploaded in the past and ignore.
let new_upload_list = event.detail.input_file_list_processed;
$ae_app.archives.input_file_list = new_upload_list;
$idaa_loc.archives.input_file_list = new_upload_list;
// Setting the first file as the default. For now other files are ignored?
if (new_upload_list.length) {
$ae_app.archives.input_filename = new_upload_list[0].filename;
$ae_app.archives.input_file_extension = new_upload_list[0].guessed_extension;
$idaa_loc.archives.input_filename = new_upload_list[0].filename;
$idaa_loc.archives.input_file_extension = new_upload_list[0].guessed_extension;
} else {
$ae_app.archives.input_filename = '';
$ae_app.archives.input_file_extension = '';
$idaa_loc.archives.input_filename = '';
$idaa_loc.archives.input_file_extension = '';
}
// for (let file_upload_item of new_upload_list) {
@@ -333,7 +333,7 @@ function handle_input_file_list_updated(event) {
// }
}
$ae_app.archives.form_file_upload_list = [];
$idaa_loc.archives.form_file_upload_list = [];
async function handle_delete_archive_content_obj({archive_content_id, hosted_file_id=null, method='delete'}) {
console.log('*** handle_delete_archive_content_obj() ***');
@@ -536,11 +536,11 @@ function tinymce_remove() {
on:input_file_list_updated = {handle_input_file_list_updated}
use_selected_file_table={true}
/>
<!-- bind:input_file_list = {$ae_app.archives.form_file_upload_list} -->
<!-- bind:input_file_list = {$idaa_loc.archives.form_file_upload_list} -->
{/if}
<label for="file_path">File Path
{#if !$ae_app.administrator_access}
{#if !$ae_loc.administrator_access}
<span class="fas fa-lock" title="Field is locked"></span>
{:else}
<span class="fas fa-unlock" title="Field is unlocked"></span>
@@ -550,16 +550,16 @@ function tinymce_remove() {
id="file_path"
name="file_path"
value={($slct.archive_content_obj.file_path ? $slct.archive_content_obj.file_path : '')}
readonly={!$ae_app.administrator_access}
readonly={!$ae_loc.administrator_access}
>
</label>
<label for="filename">Filename
<input type="text" id="filename" name="filename" value={($slct.archive_content_obj.filename ? $slct.archive_content_obj.filename : $ae_app.archives.input_filename)}>
<input type="text" id="filename" name="filename" value={($slct.archive_content_obj.filename ? $slct.archive_content_obj.filename : $idaa_loc.archives.input_filename)}>
</label>
<label for="file_extension">File Extension
{#if !$ae_app.administrator_access}
{#if !$ae_loc.administrator_access}
<span class="fas fa-lock" title="Field is locked"></span>
{:else}
<span class="fas fa-unlock" title="Field is unlocked"></span>
@@ -568,8 +568,8 @@ function tinymce_remove() {
type="text"
id="file_extension"
name="file_extension"
value={($slct.archive_content_obj.file_extension ? $slct.archive_content_obj.file_extension : $ae_app.archives.input_file_extension)}
readonly={!$ae_app.administrator_access}
value={($slct.archive_content_obj.file_extension ? $slct.archive_content_obj.file_extension : $idaa_loc.archives.input_file_extension)}
readonly={!$ae_loc.administrator_access}
>
</label>
@@ -624,7 +624,7 @@ function tinymce_remove() {
</label>
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<section class="ae_section archive_content__admin_options"> <!-- BEGIN: section archive_content__admin_options -->
<h3>
@@ -657,7 +657,7 @@ function tinymce_remove() {
<label>Group <input type="text" name="group" value={$slct.archive_content_obj.group} max="100" /></label>
{#if $ae_app.administrator_access}
{#if $ae_loc.administrator_access}
<label>Enable
<input
type="checkbox"

View File

@@ -27,9 +27,9 @@ if ($slct.archive_id) {
content: null,
topic_id: null,
anonymous: false,
external_person_id: $ae_app.novi_uuid,
full_name: $ae_app.novi_full_name,
email: $ae_app.novi_email,
external_person_id: $idaa_loc.novi_uuid,
full_name: $idaa_loc.novi_full_name,
email: $idaa_loc.novi_email,
sort: null,
notes: null,
@@ -506,7 +506,7 @@ function tinymce_remove() {
</fieldset> -->
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<section class="ae_section archive__admin_options"> <!-- BEGIN: section archive__admin_options -->
<h3>
@@ -539,7 +539,7 @@ function tinymce_remove() {
<label>Group <input type="text" name="group" value={$slct.archive_obj.group} max="100" /></label>
{#if $ae_app.administrator_access}
{#if $ae_loc.administrator_access}
<label>Enable
<input
type="checkbox"

View File

@@ -55,12 +55,12 @@ $: if ($slct_trigger == 'load__archive_content_obj_li' && $slct.archive_id) {
async function handle_load_archive_content_obj_li({archive_id, try_cache=false}) {
console.log('*** handle_load_archive_content_obj_li() ***');
let enabled = $ae_app.archives.enabled;
let hidden = $ae_app.archives.hidden;
let limit = $ae_app.archives.limit;
let offset = $ae_app.archives.offset;
// $ae_app.archives.content_group_sort = 'DESC'; // 'ASC' or 'DESC'
let group_sort = $ae_app.archives.content_group_sort; // 'ASC' or 'DESC'
let enabled = $idaa_loc.archives.enabled;
let hidden = $idaa_loc.archives.hidden;
let limit = $idaa_loc.archives.limit;
let offset = $idaa_loc.archives.offset;
// $idaa_loc.archives.content_group_sort = 'DESC'; // 'ASC' or 'DESC'
let group_sort = $idaa_loc.archives.content_group_sort; // 'ASC' or 'DESC'
let params = {};
@@ -139,9 +139,9 @@ function handle_created_archive_content_obj(event) {
$slct_trigger = 'load__archive_content_obj_li';
$ae_app.archives.show_list__event_obj_li = true;
$ae_app.archives.show_edit__archive_content_id = false;
$ae_app.archives.show_view__archive_content_id = false;
$idaa_loc.archives.show_list__event_obj_li = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
$idaa_loc.archives.show_view__archive_content_id = false;
}
function handle_updated_archive_content_obj(event) {
@@ -150,9 +150,9 @@ function handle_updated_archive_content_obj(event) {
$slct_trigger = 'load__archive_content_obj_li';
$ae_app.archives.show_list__event_obj_li = true;
$ae_app.archives.show_edit__archive_content_id = false;
$ae_app.archives.show_view__archive_content_id = false;
$idaa_loc.archives.show_list__event_obj_li = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
$idaa_loc.archives.show_view__archive_content_id = false;
}
function handle_deleted_archive_content_obj(event) {
@@ -161,9 +161,9 @@ function handle_deleted_archive_content_obj(event) {
$slct_trigger = 'load__archive_content_obj_li';
$ae_app.archives.show_list__event_obj_li = true;
$ae_app.archives.show_edit__archive_content_id = false;
$ae_app.archives.show_view__archive_content_id = false;
$idaa_loc.archives.show_list__event_obj_li = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
$idaa_loc.archives.show_view__archive_content_id = false;
}
</script>
@@ -178,14 +178,14 @@ function handle_deleted_archive_content_obj(event) {
<button
class="ae_btn btn btn-info ae_margin_sm"
on:click={() => {
if ($ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group) {
$ae_app.archives.show_list__archive_content_li_group = null;
if ($idaa_loc.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group) {
$idaa_loc.archives.show_list__archive_content_li_group = null;
} else {
$ae_app.archives.show_list__archive_content_li_group = idaa_archive_content_obj.group;
$idaa_loc.archives.show_list__archive_content_li_group = idaa_archive_content_obj.group;
}
}}
>
{#if $ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
{#if $idaa_loc.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
<span class="fas fa-caret-down" in:fade={{ duration: 250 }}
out:fade={{ duration: 0 }}></span>
<!-- <span class="fas fa-minus"></span> -->
@@ -202,8 +202,8 @@ function handle_deleted_archive_content_obj(event) {
</button>
</div>
{/if}
{#if $ae_app.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
<!-- class:ae_d_none={$ae_app.archives.show_list__archive_content_li_group != idaa_archive_content_obj.group} -->
{#if $idaa_loc.archives.show_list__archive_content_li_group == idaa_archive_content_obj.group}
<!-- class:ae_d_none={$idaa_loc.archives.show_list__archive_content_li_group != idaa_archive_content_obj.group} -->
<div
id={`idaa_archive_content_id__${idaa_archive_content_obj.archive_content_id_random}`}
class="container archive_content ae_object archive_content_obj"
@@ -219,18 +219,18 @@ function handle_deleted_archive_content_obj(event) {
{#if idaa_archive_content_obj.type}<span class="badge badge-info bg-info"><span class="fas fa-user-md"></span> {idaa_archive_content_obj.type}</span>{/if}
{#if $ae_app.trusted_access && idaa_archive_content_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
{#if $ae_app.administrator_access && !idaa_archive_content_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
{#if $ae_loc.trusted_access && idaa_archive_content_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
{#if $ae_loc.administrator_access && !idaa_archive_content_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
</h3>
</header>
<section class="ae_options archive_content_obj__options">
{#if idaa_archive_content_obj.archive_content_id_random != $ae_app.archives.show_view__archive_content_media}
{#if idaa_archive_content_obj.archive_content_id_random != $idaa_loc.archives.show_view__archive_content_media}
<button
on:click={ () => {
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
$slct.archive_content_obj = idaa_archive_content_obj;
$ae_app.archives.show_view__archive_content_media = $slct.archive_content_id;
$idaa_loc.archives.show_view__archive_content_media = $slct.archive_content_id;
// idaa_archive_content_obj.show_view__archive_content_media = true;
}}
class="ae_btn btn_md btn btn-md btn-primary"
@@ -256,7 +256,7 @@ function handle_deleted_archive_content_obj(event) {
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
$slct.archive_content_obj = idaa_archive_content_obj;
$ae_app.archives.show_view__archive_content_media = false;
$idaa_loc.archives.show_view__archive_content_media = false;
// idaa_archive_content_obj.show_view__archive_content_media = false;
}}
class="ae_btn btn_md btn btn-md btn-secondary"
@@ -273,7 +273,7 @@ function handle_deleted_archive_content_obj(event) {
</button>
{/if}
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<a href="{$ae_app.app.base_url}{idaa_archive_content_obj.hosted_file_path}" class="ae_btn btn_md btn btn-md btn-secondary" title="Download this file">
<span class="fas fa-download"></span>
Download <!-- This really should check the file type: view, show, play, listen, watch -->
@@ -287,7 +287,7 @@ function handle_deleted_archive_content_obj(event) {
</a>
{/if}
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<button
on:click={() => {
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
@@ -298,11 +298,11 @@ function handle_deleted_archive_content_obj(event) {
// url.searchParams.set('archive_content_id', idaa_archive_content_obj.archive_content_id_random);
// history.pushState({}, '', url);
// $ae_app.archives.show_main__options = true;
// $ae_app.archives.show_list__archive_content_li = true;
// $ae_app.archives.show_view__archive_content_id = false;
$ae_app.archives.show_view__archive_content_media = false;
$ae_app.archives.show_edit__archive_content_id = true;
// $idaa_loc.archives.show_main__options = true;
// $idaa_loc.archives.show_list__archive_content_li = true;
// $idaa_loc.archives.show_view__archive_content_id = false;
$idaa_loc.archives.show_view__archive_content_media = false;
$idaa_loc.archives.show_edit__archive_content_id = true;
}}
class="ae_btn ae_smallest btn btn-warning"
title={`Edit content: ${idaa_archive_content_obj.name}`}
@@ -324,7 +324,7 @@ function handle_deleted_archive_content_obj(event) {
<!-- Doing some checks before the media player/viewer shows. The player should be the only one showing. So there is a sort of global check first. -->
{#if idaa_archive_content_obj.archive_content_id_random == $ae_app.archives.show_view__archive_content_media}
{#if idaa_archive_content_obj.archive_content_id_random == $idaa_loc.archives.show_view__archive_content_media}
<Player_archive_content_obj archive_content_id={idaa_archive_content_obj.archive_content_id_random} />
{/if}
@@ -371,7 +371,7 @@ function handle_deleted_archive_content_obj(event) {
<section
class="ae_section ae_footer ae_meta archive_content__meta"
class:ae_d_none={!$ae_app.administrator_access}
class:ae_d_none={!$ae_loc.administrator_access}
>
<span
class="archive_content__archive_content_type"
@@ -403,7 +403,7 @@ function handle_deleted_archive_content_obj(event) {
</section>
{#if $ae_app.archives.show_edit__archive_content_id}
{#if $idaa_loc.archives.show_edit__archive_content_id}
<!-- <section class="ae_edit archive_content_obj archive_content_id idaa_archive_content_id_edit"> -->
<Element_modal_v3
show = { true }
@@ -412,11 +412,11 @@ function handle_deleted_archive_content_obj(event) {
$slct.archive_content_id = null;
$slct.archive_content_obj = {};
// $ae_app.archives.show_main__options = true;
// $ae_app.archives.show_list__archive_content_li = true;
$ae_app.archives.show_view__archive_content_media = false;
$ae_app.archives.show_edit__archive_content_id = false;
// $ae_app.archives.show_view__archive_content_id = false;
// $idaa_loc.archives.show_main__options = true;
// $idaa_loc.archives.show_list__archive_content_li = true;
$idaa_loc.archives.show_view__archive_content_media = false;
$idaa_loc.archives.show_edit__archive_content_id = false;
// $idaa_loc.archives.show_view__archive_content_id = false;
const url = new URL(location);
url.searchParams.delete('archive_content_id');

View File

@@ -31,8 +31,8 @@ onMount(() => {
</span>
{/if}
{#if $ae_app.trusted_access && idaa_archive_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
{#if $ae_app.administrator_access && !idaa_archive_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
{#if $ae_loc.trusted_access && idaa_archive_obj.hide}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Hidden</span>{/if}
{#if $ae_loc.administrator_access && !idaa_archive_obj.enable}<span class="badge badge-warning"><span class="fas fa-exclamation-triangle"></span> Not enabled</span>{/if}
</div>
<div class="ae_options archive_obj__options">
@@ -40,13 +40,13 @@ onMount(() => {
on:click={() => {
$slct.archive_id = idaa_archive_obj.archive_id_random;
$slct.archive_obj = idaa_archive_obj;
$ae_app.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
$idaa_loc.archives.content_group_sort = $slct.archive_obj.cfg_json.content_group_sort;
$slct_trigger = 'load__archive_obj';
$ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_obj = false;
}}
class="btn btn-secondary"
title={`View: ${idaa_archive_obj.name}`}
@@ -54,17 +54,17 @@ onMount(() => {
<span class="fas fa-envelope-open"></span> Open
</button>
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<button
on:click={() => {
$slct.archive_id = idaa_archive_obj.archive_id_random;
$slct.archive_obj = idaa_archive_obj;
$slct_trigger = 'load__archive_obj';
// $ae_app.archives.show_main__options = true;
// $ae_app.archives.show_list__archive_obj_li = true;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = true;
// $idaa_loc.archives.show_main__options = true;
// $idaa_loc.archives.show_list__archive_obj_li = true;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = true;
}}
class="ae_btn ae_smallest btn btn-warning"
title={`Edit archive: ${idaa_archive_obj.name}`}

View File

@@ -23,10 +23,10 @@ if ($slct.archive_id) {
url.searchParams.set('archive_id', $slct.archive_id);
history.pushState({}, '', url);
// $ae_app.archives.show_main__options = true;
$ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_edit__archive_obj = false;
$ae_app.archives.show_view__archive_obj = true;
// $idaa_loc.archives.show_main__options = true;
$idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_edit__archive_obj = false;
$idaa_loc.archives.show_view__archive_obj = true;
}
onMount(() => {
@@ -44,10 +44,10 @@ function handle_archive_content_obj_created(event) {
$slct_trigger = 'load__archive_obj';
$slct_trigger = 'load__archive_content_obj_li';
// $ae_app.archives.show_list__archive_obj_li = false;
// $ae_app.archives.show_edit__archive_obj = false;
// $ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_content_id = false;
// $idaa_loc.archives.show_list__archive_obj_li = false;
// $idaa_loc.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
}
function handle_archive_content_obj_updated(event) {
console.log('*** handle_archive_content_obj_updated() ***');
@@ -56,10 +56,10 @@ function handle_archive_content_obj_updated(event) {
$slct_trigger = 'load__archive_obj';
$slct_trigger = 'load__archive_content_obj_li';
// $ae_app.archives.show_list__archive_obj_li = false;
// $ae_app.archives.show_edit__archive_obj = false;
// $ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_content_id = false;
// $idaa_loc.archives.show_list__archive_obj_li = false;
// $idaa_loc.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
}
function handle_archive_content_obj_deleted(event) {
console.log('*** handle_archive_content_obj_deleted() ***');
@@ -69,10 +69,10 @@ function handle_archive_content_obj_deleted(event) {
$slct_trigger = 'load__archive_obj';
$slct_trigger = 'load__archive_content_obj_li';
// $ae_app.archives.show_list__archive_obj_li = false;
// $ae_app.archives.show_edit__archive_obj = false;
// $ae_app.archives.show_view__archive_obj = true;
$ae_app.archives.show_edit__archive_content_id = false;
// $idaa_loc.archives.show_list__archive_obj_li = false;
// $idaa_loc.archives.show_edit__archive_obj = false;
// $idaa_loc.archives.show_view__archive_obj = true;
$idaa_loc.archives.show_edit__archive_content_id = false;
}
</script>
@@ -112,7 +112,7 @@ function handle_archive_content_obj_deleted(event) {
<section
class="ae_section ae_meta archive__meta"
class:ae_d_none={!$ae_app.administrator_access}
class:ae_d_none={!$ae_loc.administrator_access}
>
<div class="ae_group">
<div class="archive__created_on_updated_on">
@@ -125,14 +125,14 @@ function handle_archive_content_obj_deleted(event) {
</div>
</div>
{#if $ae_app.trusted_access}
{#if $ae_loc.trusted_access}
<div class="ae_options">
{#if $ae_app.trusted_access || $slct.archive_obj.external_person_id === $ae_app.novi_uuid}
{#if $ae_loc.trusted_access || $slct.archive_obj.external_person_id === $idaa_loc.novi_uuid}
<button
on:click={() => {
$slct.archive_content_id = null;
$slct.archive_content_obj = {};
$ae_app.archives.show_edit__archive_content_id = true;
$idaa_loc.archives.show_edit__archive_content_id = true;
}}
class="ae_btn ae_smallest btn btn-warning"
title={`Add content for: ${$slct.archive_obj.name}`}
@@ -149,10 +149,10 @@ function handle_archive_content_obj_deleted(event) {
// url.searchParams.set('archive_id', $slct.archive_obj.archive_id_random);
// history.pushState({}, '', url);
// $ae_app.archives.show_main__options = false;
// $ae_app.archives.show_list__archive_obj_li = false;
$ae_app.archives.show_view__archive_obj = false;
$ae_app.archives.show_edit__archive_obj = true;
// $idaa_loc.archives.show_main__options = false;
// $idaa_loc.archives.show_list__archive_obj_li = false;
$idaa_loc.archives.show_view__archive_obj = false;
$idaa_loc.archives.show_edit__archive_obj = true;
}}
class="ae_btn ae_smallest btn btn-xs btn-warning"
title={`Edit archive: ${$slct.archive_obj.name}`}
@@ -190,15 +190,15 @@ function handle_archive_content_obj_deleted(event) {
</div>
</div>
{#if $ae_app.trusted_access || idaa_archive_content_obj.external_person_id === $ae_app.novi_uuid}
{#if $ae_loc.trusted_access || idaa_archive_content_obj.external_person_id === $idaa_loc.novi_uuid}
<div class="ae_options">
<button on:click={() => {
$slct.archive_content_id = idaa_archive_content_obj.archive_content_id_random;
$slct.archive_content_obj = idaa_archive_content_obj;
// $ae_app.archives.show_archive_content_list = false;
$ae_app.archives.show_edit__archive_content_id = true;
// $ae_app.archives.show_view__archive_obj = false;
// $idaa_loc.archives.show_archive_content_list = false;
$idaa_loc.archives.show_edit__archive_content_id = true;
// $idaa_loc.archives.show_view__archive_obj = false;
}}
class="btn btn-default"
>