diff --git a/GEMINI.md b/GEMINI.md index b80b79e0..fd20d9ea 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -3,9 +3,11 @@ This project is a Svelte and SvelteKit based application, part of the Aether (AE) system. It uses Tailwind CSS and Skeleton for styling and some elements. This is the frontend UI/UX. The backend API uses Python FastAPI. Core Aether modules +* accounts - client account, not user account * hosted_files -* person +* people * users +* sites and site_domains Additional Aether modules * events diff --git a/TODO.md b/TODO.md index 5d1f2bcb..c67213f2 100644 --- a/TODO.md +++ b/TODO.md @@ -4,11 +4,11 @@ This is a list of tasks to be completed before the next event/show/conference. ## Priority Tasks (Easy & Quick) -- [ ] **Core:** Define `Account`, `Site`, and `SiteDomain` interfaces in new files under `src/lib/ae_core/`. -- [ ] **Journals:** Improve the empty state message in `src/routes/journals/+page.svelte`. -- [ ] **Journals:** Add a loading indicator to the main journals page. -- [ ] **IDAA:** Add a loading indicator to the archives page (`src/routes/idaa/(idaa)/archives/+page.svelte`). -- [ ] **Events:** Add pagination to the main event list in `src/routes/events/+page.svelte`. +- [x] **Core:** Define `Account`, `Site`, and `Site_Domain` interfaces in new files under `src/lib/ae_core/`. +- [x] **Journals:** Improve the empty state message in `src/routes/journals/+page.svelte`. +- [x] **Journals:** Add a loading indicator to the main journals page. +- [x] **IDAA:** Add a loading indicator to the archives page (`src/routes/idaa/(idaa)/archives/+page.svelte`). +- [x] **Events:** Add pagination to the main event list in `src/routes/events/+page.svelte`. --- @@ -53,7 +53,7 @@ These functions are frequently used and critical to the application's data flow. ### 3. Site & Domain Management - [ ] **Route:** Create a new route at `/core/sites`. -- [ ] **Data:** Define `Site` and `SiteDomain` interfaces in a new file `src/lib/ae_core/core__site.ts`. +- [ ] **Data:** Define `Site` and `Site_Domain` interfaces in a new file `src/lib/ae_core/core__site.ts`. - [ ] **API:** Implement functions in `core__site.ts` for CRUD operations on sites and domains. - [ ] **UI:** - [ ] Create a `+page.svelte` to list all sites. diff --git a/src/lib/ae_core/core__account.ts b/src/lib/ae_core/core__account.ts new file mode 100644 index 00000000..58d70a3a --- /dev/null +++ b/src/lib/ae_core/core__account.ts @@ -0,0 +1,23 @@ +export interface Account { + id: string; + // id_random: string; + account_id: string; + account_id_random: string; + + code?: string; + name: string; + short_name?: null|string; + description?: null|string; + + enable: null|boolean; + enable_from?: null|Date; + enable_to?: null|Date; + + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; + created_on: Date; + updated_on?: null|Date; +} \ No newline at end of file diff --git a/src/lib/ae_core/core__site.ts b/src/lib/ae_core/core__site.ts new file mode 100644 index 00000000..19268899 --- /dev/null +++ b/src/lib/ae_core/core__site.ts @@ -0,0 +1,50 @@ +export interface Site { + id: string; + // id_random: string; + site_id: string; + site_id_random?: string; + + code?: string; + + account_id: string; + account_id_random?: string; + + name: string; + description?: null|string; + + restrict_access?: null|boolean; + access_key?: null|string; + access_code_kv_json?: null|string; + + logo_path?: null|string; + logo_bg_color?: null|string; // Not really used currently. + // background_image_path?: null|string; // Legacy field + // background_bg_color?: null|string; // Legacy field + title?: null|string; + + // header_html?: null|string; // Legacy field + // header_css?: null|string; // Legacy field + // header_image_path?: null|string; // Legacy field + // header_image_bg_color?: null|string; // Legacy field + // body_html?: null|string; // Legacy field + tagline?: null|string; + // site_header_h1?: null|string; // Legacy field + // site_header_h2?: null|string; // Legacy field + style_href?: null|string; // Legacy field + // script_src?: null|string; // Legacy field + google_tracking_id?: null|string; + + cfg_json?: null|string; // key value config json + + enable: null|boolean; + enable_from?: null|Date; + enable_to?: null|Date; + + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; + created_on: Date; + updated_on?: null|Date; +} \ No newline at end of file diff --git a/src/lib/ae_core/core__site_domain.ts b/src/lib/ae_core/core__site_domain.ts new file mode 100644 index 00000000..964ed989 --- /dev/null +++ b/src/lib/ae_core/core__site_domain.ts @@ -0,0 +1,20 @@ +export interface Site_Domain { + id: string; + // id_random: string; + site_id: string; + site_id_random?: string; + + fqdn: string; + access_key?: null|string; + required_referrer?: null|string; + valid_for?: null|number; // In hours + + enable: null|boolean; + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; + created_on: Date; + updated_on?: null|Date; +} \ No newline at end of file diff --git a/src/routes/events/+page.svelte b/src/routes/events/+page.svelte index a70c06b7..44bf6fef 100644 --- a/src/routes/events/+page.svelte +++ b/src/routes/events/+page.svelte @@ -28,6 +28,29 @@ let lq__event_obj_li = $derived(liveQuery(async () => { return results; })); +let items_per_page = 10; +let current_page = $state(1); + +let paginated_events = $derived(() => { + const start = (current_page - 1) * items_per_page; + const end = start + items_per_page; + return $lq__event_obj_li?.slice(start, end) ?? []; +}); + +let total_events = $derived($lq__event_obj_li?.length ?? 0); +let total_pages = $derived(Math.ceil(total_events / items_per_page)); + +function next_page() { + if (current_page < total_pages) { + current_page++; + } +} + +function prev_page() { + if (current_page > 1) { + current_page--; + } +} onMount(() => { // console.log('Events - Presentation Management: +page.svelte'); @@ -85,7 +108,7 @@ onMount(() => { +
+ + Page {current_page} of {total_pages} + +
{:else}
@@ -157,3 +185,4 @@ onMount(() => { + diff --git a/src/routes/idaa/(idaa)/archives/+page.svelte b/src/routes/idaa/(idaa)/archives/+page.svelte index 3ffcb849..809abe28 100644 --- a/src/routes/idaa/(idaa)/archives/+page.svelte +++ b/src/routes/idaa/(idaa)/archives/+page.svelte @@ -145,10 +145,20 @@ function add_activity_log( > -{#if $lq__archive_obj_li && $lq__archive_obj_li?.length} - -{:else} -

No archives available to show.

-{/if} +{#await lq__archive_obj_li} +
+ + Loading archives... +
+{:then} + {#if $lq__archive_obj_li && $lq__archive_obj_li?.length} + + {:else} +
+

No archives found.

+

Archives will appear here once created.

+
+ {/if} +{/await} diff --git a/src/routes/journals/+page.svelte b/src/routes/journals/+page.svelte index f75cf0a5..51d66696 100644 --- a/src/routes/journals/+page.svelte +++ b/src/routes/journals/+page.svelte @@ -253,9 +253,9 @@ async function create_journal() { {#await ae_acct.slct.journal_obj_li} -
- - Loading data... +
+ + Loading journals...
@@ -272,7 +272,10 @@ async function create_journal() { lq__journal_obj_li={lq__journal_obj_li} /> {:else} -

No journals available to show.

+
+

No journals found.

+

Click the "New Journal" button above to create your first journal.

+
{/if}