The archives are looking better now. Mostly style and sorting improvements.

This commit is contained in:
Scott Idem
2024-11-12 16:20:18 -05:00
parent fedbbe9ae2
commit 34bcd9dd2d
8 changed files with 102 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
/** @type {import('./$types').PageData} */
export let data: any;
let log_lvl = 0;
let log_lvl = 1;
// Imports
import { Modal } from 'flowbite-svelte';
@@ -55,14 +55,30 @@ $: lq__archive_obj = liveQuery(async () => {
});
$: lq__archive_content_obj_li = liveQuery(async () => {
let results = await db_archives.content
.where('archive_id')
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
.reverse()
.sortBy('updated_on');
// .sortBy('title');
if (log_lvl) {
console.log(`$lq__archive_obj.cfg_json = `, $lq__archive_obj?.cfg_json);
}
if ($lq__archive_obj?.cfg_json?.content_group_sort === 'DESC') {
let results = await db_archives.content
// .orderBy('updated_on')
.where('archive_id')
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
.reverse()
.sortBy('tmp_sort_2');
// .sortBy('updated_on');
// .sortBy('title');
return results;
} else {
let results = await db_archives.content
.where('archive_id')
.equals($idaa_slct?.archive_id ?? '') // null or undefined does not reset things like '' does
// .reverse()
.sortBy('tmp_sort_2');
return results;
}
return results;
});
$: lq__archive_content_obj = liveQuery(async () => {