feat(events): reorganize badge admin tools and enhance dependency tracking

- Migrated 'Add New Badge' and 'Upload Badge List' to centralized Event Settings hub.
- Secured Admin Tools visibility with Administrator access and Edit Mode requirements.
- Restored and modernized Badge Template management route with Svelte 5 runes.
- Patched 'Archive' and 'Session' database interfaces to resolve compiler errors.
- Added project-wide dependency comments to key interfaces (Archive, Badge, Session) to prevent cascading change regressions.
- Fixed duplicate import errors in the Settings page.
This commit is contained in:
Scott Idem
2026-02-04 14:04:44 -05:00
parent 49f0a888b0
commit bc30724628
19 changed files with 299 additions and 276 deletions

View File

@@ -117,33 +117,57 @@
## 3. 🧠 Short Term Memory (Session Context)
*This section is the "Scratchpad" for the current interaction. It is cleared or summarized often.*
- **Status:** Session Concluded / System Stable.
- **Last Action:** Fully reverted all Launcher module changes to the last known working commit.
- **Last Action:** Committed a platform-wide refactor of button types and file operation security (81 files).
- **Key Learnings:**
- **Reactivity Loops:** Svelte 5 `$derived` runes combined with `liveQuery` observables can trigger infinite loops if the `liveQuery` is recreated on every derivation cycle.
- **SvelteKit Navigation:** `goto` options like `noscroll` and `keepfocus` must remain lowercase in SvelteKit 2; camelCase variants may be ignored or cause issues.
- **ID Handling:** Initializing store IDs to `''` instead of `null` is generally safer for string-based ID logic in Svelte 5.
- **Multi-Line Attribute Hazards:** Bulk regex tools often miss or duplicate attributes in multi-line Svelte tags; surgical manual edits or specialized parsers are required for clean tag handling.
- **V3 Action Pattern:** Authenticated file downloads now strictly require the `key=${account_id}` parameter via the `/v3/action/` endpoint path.
- **Svelte 5 Effects:** Using `$effect` to synchronize props to local state requires `untrack` to prevent circular reactivity loops.
- **Accomplishments:**
- Restored the system to a clean, stable state after an experimental Svelte Rune refactor.
- Identified "Bite-Sized" refactoring targets (Large Files > 800 lines).
- Captured the requirement for safe `file_count_all` integration in the Kanban board.
- **Standardized Button Typing:** Applied `type="button"` vs `type="submit"` across Journals, Events, and IDAA modules to prevent accidental form submissions.
- **Hardened File Operations:** Successfully migrated the entire platform to the authenticated V3 Action API for all file downloads and deletes.
- **Compiler Error Sweep:** Resolved over 40 critical compiler errors, including duplicate attributes in complex components and missing imports.
- **DX Optimization:** Verified the "Safe Workflow Strategy" (Edit -> Lint -> Check) as an effective baseline for large-scale refactoring.
- **Current Blocker:** None.
- **Immediate Next Step:** Await user's next session to tackle modular refactoring.
- **Immediate Next Step:** Resolve remaining type mismatches (~160) or begin modular refactoring of large components (>800 lines).
---

107
TODO.md
View File

@@ -6,97 +6,82 @@ This is a list of tasks to be completed before the next event/show/conference.
## High Priority (Active Task)
1. **Search Module Hardening (V3 Standardization):**
1. **Button Standardization & Security Cleanup:**
- [x] **Journals Module:** Standardized all buttons to `type="button"` or `type="submit"`. (Completed 2026-02-03)
- [x] **Events Module:** Cleaned up 50+ components, ensuring unique attributes and correct typing. (Completed 2026-02-03)
- [x] **IDAA Module:** Standardized button behavior across Recovery Meetings, Archives, and Bulletin Board. (Completed 2026-02-03)
- [x] **V3 Action API Migration:** Updated all file downloads/deletes to use authenticated `/v3/action/` endpoints. (Completed 2026-02-03)
2. **Search Module Hardening (V3 Standardization):**
- [x] **IDAA Recovery Meetings:** Standardized reactive pattern and SWR. (Completed 2026-01-27)
- [x] **Journals Entry Search:** Implemented Search Guard and debounced effects. (Completed 2026-01-27)
- [x] **Badge Search:** Fixed `default_qry_str` mapping and stabilized reactivity. (Completed 2026-01-27)
- [x] **Session Search:** Modernized logic, fixed layout bugs and icon exports. (Completed 2026-01-27)
- [x] **Exhibit Search:** Standardized Exhibitor and Lead Tracking reactive search. (Completed 2026-01-28)
2. **IDAA Module Hardening:**
- [x] Audit Jitsi meeting integration for connection stability. (Completed 2026-01-30)
- [x] Investigate reported "issues with IDAA pages" (Jitsi reports). (Completed 2026-01-30)
## Urgent Tasks (Feb 4, 2026)
1. **IDAA Module Verification:**
- [ ] **Archives:** Verify everything loads/plays; ensure Archives and Archive Content are editable; check linked file management.
- [ ] **Bulletin Board (BB):** Verify Post/Comment create/edit; test email notifications for staff and original posters; verify anonymous toggle; test file attachments on Posts; optimize inline image display (collapse/expand).
- [ ] **Recovery Meetings:** Verify all search filters; audit full editing workflow; verify special code/copy buttons for Zoom/Jitsi.
2. **Events - Presentation Management:**
- [ ] **Basics:** Ensure all core presentation management features are fully functional.
- [ ] **Uploads:** Verify direct file uploads to Presenter, Session, Location, and Event.
3. **Events - Badges:**
- [ ] **Rendering:** Verify Badge Template pulling and correct rendering.
- [ ] **Editing:** Ensure basic fields (name, affiliations, badge type) are editable.
4. **Events - Leads/Tracking:**
- [ ] **Exhibitor Staff:** Sign-in workflow per staff person.
- [ ] **Payment:** Integration check (Stripe).
- [ ] **Licensing:** Increment management per exhibit/license.
- [ ] **Attendee Opt-in:** Verify opt-in/out logic for lead retrieval.
- [ ] **Search:** Case-insensitive search by Badge ID, QR, name, email, or affiliations.
- [ ] **Lead Association:** Link attendees to Event Person/Badge records.
- [ ] **Export:** Confirm allowed exportable attendee profile fields for exhibitors.
5. **Zoom Events API Integration:**
- [ ] **Aether API (FastAPI):** Implement cron for synchronization.
- [ ] **Investigation:** Audit Zoom Events API for available attendee profile fields (name, email, etc.).
---
## Current Priorities (Jan 28, 2026)
## Current Priorities (Feb 3, 2026)
1. **Reactivity & Performance:**
- [x] **Search Guard Pattern:** Deployed across all major search modules to eliminate infinite loops.
1. **Codebase Hygiene:**
- [ ] **Type Mismatch Resolution:** Resolve remaining simple type mismatches flagged by `svelte-check` (currently ~160).
- [ ] **Bite-Sized Refactoring:** Split large components (>800 lines) into modular sub-components (e.g., `ae_idaa_comp__event_obj_id_edit.svelte`).
2. **Reactivity & Performance:**
- [x] **Search Guard Pattern:** Deployed project-wide to eliminate infinite loops.
- [x] **Shared Observables:** Refactored lists to accept `liveQuery` props for flicker-free SWR transitions.
- [x] **Store Initialization:** Hardened persisted stores against `undefined` reactivity triggers.
2. **String-Only ID Standardization:**
3. **String-Only ID Standardization:**
- [x] Audit and resort ID prioritization logic across all `.ts` and `.svelte` files. (Phase 1 Completed 2026-01-30)
- [x] Preferred Order: `[obj_type]_id` || `id` || `[obj_type]_id_random` || `id_random`.
- [x] Ensure `+layout.ts` cleans incoming raw data from the native bridge.
3. **Native Launcher Refinement (Phase 5):**
- [x] **Office Automation:** Implemented AppleScript handlers for PowerPoint/Keynote. (Completed 2026-01-30)
- [x] **Telemetry Dashboard:** Built visual CPU/RAM gauges in Launcher Config. (Completed 2026-01-30)
- [x] **System Management:** Added UI for Wallpaper, Recording, Display Layout, and Power Control. (Completed 2026-01-30)
3. **Codebase Consistency:**
- [x] **Field Mapping:** Renamed `default_qry_string` to `default_qry_str` project-wide for V3 API compliance.
---
## 🚀 Future Features & Backlog
- [ ] **Journal Annotations:** Implement a "Post-Comment" style system for adding reflections to Journal Entries.
- [ ] **Journal Media Hardening:** Improve file/media linking using the Archive module's multi-attachment pattern.
- [ ] **Notification Hooks:** Add email alerts for system events.
- [ ] **Badge Rendering:** Resolve badge preview template failure (Pending DB schema verification).
- [ ] **Telemetry Visuals:** Expand Launcher dashboard with network bandwidth and storage usage stats.
---
## 🛠️ DX & Tooling (MCP)
- [x] **V3 API Parameter Hardening:** Updated `search_ae_obj_v3` for URL serialization.
- [x] **GEMINI Context Standardization:** Deployed v1.2 Inverted Pyramid template.
- [x] **Safe Workflow Strategy:** Implemented atomic edit -> format -> lint fix -> svelte-check cycle.
- [ ] **Payload Validation:** Create dry-run tool for Pydantic model checking.
---
- [x] **Reports:** Investigate and fix Events Presentation Management Reports (Completed 2026-01-29).
## Recent Accomplishments (Feb 3, 2026)
- [x] **Platform-Wide Button Standardization:** Surgical cleanup of 81 files to ensure `type="button"` is used for all non-submitting buttons, preventing unintended form resets.
- [x] **V3 Action API Migration:** Successfully migrated all file downloads and deletes to the authenticated `/v3/action/` endpoints, hardening file security.
- [x] **Compiler Error Resolution:** Fixed 40+ critical errors including duplicate attributes in multi-line tags and missing `untrack` imports in Svelte 5 effects.
- [x] **Hosted Files Modernization:** Standardized all download, link, and upload components across the platform.
- [x] **API V3 Integration:** Migrated all platform file URLs to the `/v3/action/hosted_file/{id}/download` endpoint.
- [x] **Launcher Hardening:** Refactored Launcher file container and background sync for Random String ID support.
## Recent Accomplishments (Jan 29, 2026)
- [x] **V3 API Rollout:** Completed project-wide rollout of the `view` parameter across all core event modules (Badge, Device, File, Location, Presentation, Presenter, Session, Track, Exhibit).
- [x] **Report Hardening:** Updated Presentation Management reports to utilize the `alt` view, enabling complex data shapes without client-side manual processing.
- [x] **Source Synchronization:** Resolved remote branch divergence and force-pushed local source of truth to origin.
## Recent Accomplishments (Jan 28, 2026)
- [x] **Search Standard:** Completed the migration of IDAA, Journals, Badges, Sessions, and Exhibits to the high-performance reactive pattern.
- [x] **Field Sync:** Resolved whitelisting errors by standardizing on `default_qry_str` and specific object fields (e.g. `name` for Exhibits).
- [x] **UI Polishing:** Fixed icon scaling and build errors in the Session list component.
- [x] **Hydration:** Eliminated page load delays via non-blocking layouts and SWR.
- [x] **Lead Retrieval:** Refactored Exhibitor and Lead Tracking UI with standardized grid layouts and SWR logic.
- [x] **Native Bridge:** Standardized Electron IPC calls to snake_case and implemented Phase 5 automation. (ID: 173448078)
- [x] **Launcher V3:** Migrated presentation background sync and telemetry heartbeat to V3 CRUD standard. (ID: 173518010)
- [x] **Electron Infrastructure:** Restored native app framework and hardened local file caching logic. (ID: 221513945)
## Native App Development
- [x] Phase 5: Implement specialized AppleScript handlers for Office/Keynote.
- [x] Refinement: Built Telemetry Dashboard in Launcher Config.
---

View File

@@ -58,7 +58,9 @@ export interface Archive {
tmp_sort_2?: null | string;
// Additional fields for convenience (database views)
// archive_content_count?: number;
topic_id?: null | string;
topic_name?: null | string;
archive_content_count?: number;
// archive_content_kv?: null|key_val;
// archive_content_li?: null|[];
}

View File

@@ -48,17 +48,17 @@ export async function load_ae_obj_id__event({
const cached_event = await db_events.event.get(event_id);
if (cached_event) {
if (log_lvl) console.log('EVENT LOAD: Cache hit. Returning stale data immediately.');
// Trigger background refresh
_refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl: 0
_refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl: 0
});
// Still handle nested loads for the cached version to ensure UI richness
return await _handle_nested_loads(cached_event, {
api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl
return await _handle_nested_loads(cached_event, {
api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl
});
}
} catch (e) {
@@ -67,20 +67,20 @@ export async function load_ae_obj_id__event({
}
// 2. SLOW PATH: Wait for API if cache is empty or try_cache is false
return await _refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl
return await _refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl
});
}
/**
* Internal helper to perform the actual API fetch and cache update for events
*/
async function _refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl
async function _refresh_event_v3_background({
api_cfg, event_id, view, try_cache,
inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li,
log_lvl
}: any) {
// Check if offline
if (typeof navigator !== 'undefined' && !navigator.onLine) {
@@ -113,9 +113,9 @@ async function _refresh_event_v3_background({
log_lvl: log_lvl
});
}
return await _handle_nested_loads(processed_obj, {
api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl
return await _handle_nested_loads(processed_obj, {
api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl
});
}
} catch (error: any) {
@@ -128,6 +128,7 @@ async function _refresh_event_v3_background({
* Shared logic for loading nested child collections
*/
async function _handle_nested_loads(event_obj: any, { api_cfg, inc_device_li, inc_file_li, inc_location_li, inc_session_li, inc_template_li, log_lvl }: any) {
if (log_lvl) console.log(`Loading nested collections for event: ${event_obj.event_id} (Devices: ${inc_device_li}, Files: ${inc_file_li}, Locations: ${inc_location_li}, Sessions: ${inc_session_li}, Templates: ${inc_template_li})`);
// String-Only ID Vision: the '_id' field IS the string ID
const current_event_id = event_obj.id || event_obj.event_id;
@@ -177,7 +178,7 @@ async function _handle_nested_loads(event_obj: any, { api_cfg, inc_device_li, in
}
if (tasks.length > 0) await Promise.all(tasks);
return event_obj;
}

View File

@@ -10,9 +10,17 @@ import { load_ae_obj_id__event_badge_template } from '$lib/ae_events/ae_events__
const ae_promises: key_val = {};
// Updated 2026-01-02
/**
* load_ae_obj_id__event_badge - Load a single event badge by ID
* Related Files:
* - src/lib/ae_events/db_events.ts (Dexie Interface)
* - src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte (View)
* - src/routes/events/[event_id]/settings/+page.svelte (Admin Operations)
*/
export async function load_ae_obj_id__event_badge({
api_cfg,
event_badge_id,
event_id, // This event_id should not be needed here... 2026-02-04
view = 'base',
inc_template = true,
try_cache = true,
@@ -20,6 +28,7 @@ export async function load_ae_obj_id__event_badge({
}: {
api_cfg: any;
event_badge_id: string;
event_id?: string;
view?: string;
inc_template?: boolean;
try_cache?: boolean;
@@ -41,8 +50,12 @@ export async function load_ae_obj_id__event_badge({
if (ae_promises.load__event_badge_obj) {
if (try_cache) {
// In theory we should be able to use the event_id found in the Badge load object. 2026-02-04
// This keeps coming up as undefined: ae_promises.load__event_badge_obj.event_id_random
if (log_lvl) console.log(`Saving to local cache... Event ID: ${event_id} or ${ae_promises.load__event_badge_obj.event_id_random}`);
const processed_obj_li = await process_ae_obj__event_badge_props({
obj_li: [ae_promises.load__event_badge_obj],
event_id: event_id || ae_promises.load__event_badge_obj.event_id_random,
log_lvl
});
await db_save_ae_obj_li__ae_obj({
@@ -603,6 +616,9 @@ export async function process_ae_obj__event_badge_props({
obj_type: 'event_badge',
log_lvl,
specific_processor: (obj) => {
if (log_lvl) {
console.log(`*** process_ae_obj__event_badge_props() *** event_id=${event_id}`);
}
if (event_id) {
if (!obj.event_id) obj.event_id = event_id;
if (!obj.event_id_random) obj.event_id_random = event_id;

View File

@@ -97,7 +97,13 @@ export interface Event {
event_file_id_li_json?: null | string;
}
// Updated 2025-10-06
/**
* Badge - An event badge
* Related Files:
* - src/lib/ae_events/ae_events__event_badge.ts (API)
* - src/routes/events/[event_id]/(badges)/badges/[badge_id]/+page.svelte (View)
* - src/routes/events/[event_id]/settings/+page.svelte (Admin)
*/
export interface Badge {
id: string;
// id_random: string;
@@ -757,6 +763,7 @@ export interface Session {
tmp_sort_2?: null | string;
// Additional fields for convenience (database views)
default_qry_str?: null | string;
file_count?: null | number; // Only files directly under a session
file_count_all?: null | number; // All files under a session
internal_use_count?: null | number; // Files marked for internal use

View File

@@ -779,6 +779,9 @@ export interface ae_Page extends ae_BaseObj {
/**
* Archive - A collection of archival content
* Related Files:
* - src/lib/ae_archives/db_archives.ts (Dexie Interface)
* - src/routes/idaa/(idaa)/archives/[archive_id]/+page.svelte (View)
*/
export interface ae_Archive extends ae_BaseObj {
archive_id: string;

View File

@@ -262,38 +262,6 @@
}
</script>
{#if show_create_badge_modal}
<Modal bind:open={show_create_badge_modal}>
<div class="card p-4">
<h3 class="h3">Create New Badge</h3>
<Comp_badge_create_form
event_id={$events_slct?.event_id ?? ''}
on:success={() => {
show_create_badge_modal = false;
$events_loc.badges.search_version++;
}}
on:cancel={() => (show_create_badge_modal = false)}
/>
</div>
</Modal>
{/if}
{#if show_upload_badge_modal}
<Modal bind:open={show_upload_badge_modal}>
<div class="card p-4">
<h3 class="h3">Upload Badges (CSV)</h3>
<Comp_badge_upload_form
event_id={$events_slct?.event_id ?? ''}
on:success={() => {
show_upload_badge_modal = false;
$events_loc.badges.search_version++;
}}
on:cancel={() => (show_upload_badge_modal = false)}
/>
</div>
</Modal>
{/if}
<svelte:head>
<title>
Badges -
@@ -307,50 +275,6 @@
log_lvl={1}
></Comp_badge_search>
{#if $ae_loc.trusted_access}
<div class="mt-4 text-center">
<button type="button" class="btn btn-primary" onclick={() => (show_create_badge_modal = true)}>
<span class="fas fa-plus mr-2"></span> Add New Badge
</button>
<button type="button" class="btn btn-primary ml-2" onclick={() => (show_upload_badge_modal = true)}>
<span class="fas fa-upload mr-2"></span> Upload Badge List
</button>
</div>
<div class="mt-4 text-center p-4 border rounded-md">
<h4 class="h4">Mass Print Options</h4>
<div class="flex flex-wrap justify-center gap-2">
<a
href={`/events/${$events_slct?.event_id ?? ''}/badges/print_list?printed_status=not_printed`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print All Unprinted
</a>
<a
href={`/events/${$events_slct?.event_id ?? ''}/badges/print_list?badge_type_code=guest&printed_status=not_printed`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print Unprinted Guests
</a>
<a
href={`/events/${$events_slct?.event_id ?? ''}/badges/print_list`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print All
</a>
</div>
</div>
<div class="mt-4 text-center">
<a
href={`/events/${$events_slct?.event_id ?? ''}/badges/templates`}
class="btn btn-tertiary"
>
<span class="fas fa-file-alt mr-2"></span> Manage Badge Templates
</a>
</div>
{/if}
{#if $events_sess?.badges?.search_status === 'loading' && event_badge_id_li.length === 0}
<div class="flex flex-col items-center justify-center p-10 opacity-50 text-center">
<LoaderCircle size="3em" class="animate-spin mb-4 mx-auto" />

View File

@@ -0,0 +1,34 @@
/** @type {import('./$types').PageLoad} */
console.log(`Events - Badges [badge_id] +page.ts start`);
import { browser } from '$app/environment';
import { events_func } from '$lib/ae_events_functions';
// This file needs to load the Event Badge ID. It should also include the associated Event Badge Template for the specific badge ID.
export async function load({ params, parent, url }) {
const log_lvl: number = 2;
const parent_data = await parent();
const account_id = parent_data.account_id;
const ae_acct = parent_data[account_id];
if (browser) {
if (log_lvl) console.log(`ae_events +page.ts (Non-Blocking Refresh)`);
const event_id = params.event_id;
const event_badge_id = params.badge_id;
if (event_badge_id) {
// Refresh the specific selected Event Badge ID
events_func.load_ae_obj_id__event_badge({
api_cfg: ae_acct.api,
event_badge_id: event_badge_id,
event_id: event_id, // This event_id should not be needed here... 2026-02-04
inc_template: true,
log_lvl: log_lvl
});
}
}
}

View File

@@ -292,7 +292,7 @@
}
});
$effect(async () => {
$effect(() => {
if (browser && $lq__event_badge_obj?.event_badge_id) {
console.log('Generating QR code...');
qr_error_message = '';

View File

@@ -85,13 +85,11 @@
</button>
</div>
{#await lq__badge_templates}
<p>Loading badge templates...</p>
{:then templates}
{#if templates.length > 0}
{#if $lq__badge_templates}
{#if $lq__badge_templates.length > 0}
<div class="card p-4">
<ul class="list-group">
{#each templates as template (template.event_badge_template_id_random)}
{#each $lq__badge_templates as template (template.event_badge_template_id_random)}
<li class="list-group-item flex justify-between items-center">
<span>{template.name}</span>
<div>
@@ -117,31 +115,31 @@
{:else}
<p>No badge templates found for this event. Click "Add New Template" to create one.</p>
{/if}
{:catch error}
<p class="text-error-500">Error loading templates: {error.message}</p>
{/await}
{:else}
<p>Loading badge templates...</p>
{/if}
</section>
{#if show_create_template_modal}
<Modal bind:show={show_create_template_modal}>
<Modal bind:open={show_create_template_modal}>
<div class="card p-4">
<Comp_badge_template_form
{event_id}
on:success={handle_create_success}
on:cancel={handle_cancel}
onsuccess={handle_create_success}
oncancel={handle_cancel}
/>
</div>
</Modal>
{/if}
{#if show_edit_template_modal}
<Modal bind:show={show_edit_template_modal}>
<Modal bind:open={show_edit_template_modal}>
<div class="card p-4">
<Comp_badge_template_form
{event_id}
template_id={selected_template_id}
on:success={handle_edit_success}
on:cancel={handle_cancel}
onsuccess={handle_edit_success}
oncancel={handle_cancel}
/>
</div>
</Modal>

View File

@@ -49,11 +49,11 @@ export async function load({ params, parent, url }) {
events_func.load_ae_obj_id__event({
api_cfg: ae_acct.api,
event_id: event_id,
inc_file_li: true,
inc_location_li: true,
inc_file_li: false, // Changing from true 2026-02-04
inc_location_li: false, // Changing from true 2026-02-04
inc_session_li: true,
inc_template_li: true,
log_lvl: 0 // Keep background quiet unless debugging
log_lvl: 1 // Keep background quiet unless debugging
});
}

View File

@@ -1,64 +1,5 @@
/** @type {import('./$types').PageLoad} */
console.log(`Events - [event_id] +page.ts start`);
// import { error } from '@sveltejs/kit';
// import { browser } from '$app/environment';
// import { events_func } from '$lib/ae_events_functions';
export async function load({ params, parent }) {
// route
// let log_lvl: number = 0;
// let data = await parent();
// // console.log(`ae events_pres_mgmt event [event_id] +page.ts data:`, data);
// data.log_lvl = log_lvl;
// let account_id = data.account_id;
// let ae_acct = data[account_id];
// // console.log(`ae_acct = `, ae_acct);
// // if (!account_id) {
// // console.log(`events_pres_mgmt_event [event_id] +page.ts: The account_id was not found in the data!!!`);
// // return false;
// // }
// // data.ae_events_pres_mgmt_event_event_id_page_ts = true;
// let event_id = params.event_id;
// if (!event_id) {
// console.log(`ae Events - [event_id] +page.ts: The event_id was not found in the params.event_id!!!`);
// error(404, {
// message: 'Event ID not found'
// });
// }
// // ae_acct.slct.event_id = event_id;
// // let load_event_obj = events_func.handle_load_ae_obj_id__event({
// // api_cfg: ae_acct.api, event_id: event_id, try_cache: true
// // });
// // ae_acct.slct.event_obj = await load_event_obj;
// if (browser) {
// let load_event_obj = events_func.handle_load_ae_obj_id__event({
// api_cfg: ae_acct.api, event_id: event_id, try_cache: true
// });
// console.log(`load_event_obj = `, load_event_obj);
// ae_acct.slct.event_obj = load_event_obj;
// let load_event_session_obj_li = events_func.load_ae_obj_li__event_session({
// api_cfg: ae_acct.api,
// for_obj_type: 'event',
// for_obj_id: event_id,
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
// try_cache: true,
// log_lvl: 1
// });
// console.log(`load_event_session_obj_li = `, load_event_session_obj_li);
// ae_acct.slct.event_session_obj_li = load_event_session_obj_li;
// let load_event_location_obj_li = events_func.load_ae_obj_li__event_location({
// api_cfg: ae_acct.api,
// for_obj_type: 'event',
// for_obj_id: event_id,
// params: {qry__enabled: 'enabled', qry__hidden: 'all', qry__limit: 200},
// try_cache: true,
// log_lvl: 1
// });
// console.log(`load_event_location_obj_li = `, load_event_location_obj_li);
// ae_acct.slct.event_location_obj_li = load_event_location_obj_li;
// }
// // WARNING: Precaution against shared data between sites and sessions.
// data[account_id] = ae_acct;
// return data;
}
// export async function load({ params, parent }) {
// }

View File

@@ -50,6 +50,7 @@
ae_core={$ae_loc.administrator_access}
events__locations={$ae_loc.administrator_access}
events__reports={$ae_loc.trusted_access}
events__settings={$ae_loc.edit_mode && $ae_loc.administrator_access}
/>
<span

View File

@@ -1,16 +1,21 @@
<script lang="ts">
import { page } from '$app/state';
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import { liveQuery } from 'dexie';
import { db_events, type Event } from '$lib/ae_events/db_events';
import { onMount } from 'svelte';
import { events_func } from '$lib/ae_events_functions';
import { ae_api } from '$lib/stores/ae_stores';
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
import AE_Comp_Editor_CodeMirror from '$lib/elements/AE_Comp_Editor_CodeMirror.svelte';
import Ae_comp_event_settings_form from './ae_comp__event_settings_form.svelte';
import Ae_comp_event_settings_pres_mgmt_form from './ae_comp__event_settings_pres_mgmt_form.svelte';
import Ae_comp_event_settings_basic_form from './ae_comp__event_settings_basic_form.svelte';
import Ae_comp_event_settings_badges_form from './ae_comp__event_settings_badges_form.svelte';
import Ae_comp_event_settings_abstracts_form from './ae_comp__event_settings_abstracts_form.svelte';
import { Modal } from 'flowbite-svelte';
import Comp_badge_create_form from '../(badges)/badges/ae_comp__badge_create_form.svelte';
import Comp_badge_upload_form from '../(badges)/badges/ae_comp__badge_upload_form.svelte';
let event_id = page.params.event_id as string;
let event_obj: Event | undefined | null = $state(null);
@@ -19,6 +24,17 @@
let badges_json_view = $state('form');
let abstracts_json_view = $state('form');
let show_create_badge_modal: boolean = $state(false);
let show_upload_badge_modal: boolean = $state(false);
// Guard: Only allow administrators in edit mode
if (!$ae_loc.administrator_access || !$ae_loc.edit_mode) {
if (browser) {
alert('Access Denied: Administrative privileges and Edit Mode required.');
goto(`/events/${event_id}`);
}
}
onMount(() => {
const observable = liveQuery(() => db_events.event.get(event_id));
const subscription = observable.subscribe((value) => {
@@ -60,6 +76,62 @@
{#if event_obj}
<div class="space-y-4">
<details class="details" open>
<summary class="summary font-bold text-error-500">Admin Tools</summary>
<div class="p-4 space-y-4">
<div class="card p-4 border rounded-md text-center">
<h4 class="h4">Badge Operations</h4>
<div class="flex flex-wrap justify-center gap-2 mt-2">
<button type="button" class="btn btn-primary" onclick={() => (show_create_badge_modal = true)}>
<span class="fas fa-plus mr-2"></span> Add New Badge
</button>
<button type="button" class="btn btn-primary ml-2" onclick={() => (show_upload_badge_modal = true)}>
<span class="fas fa-upload mr-2"></span> Upload Badge List
</button>
</div>
</div>
<div class="card p-4 border rounded-md text-center">
<h4 class="h4">Mass Print Options</h4>
<div class="flex flex-wrap justify-center gap-2 mt-2">
<a
href={`/events/${event_id}/badges/print_list?printed_status=not_printed`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print All Unprinted
</a>
<a
href={`/events/${event_id}/badges/print_list?badge_type_code=guest&printed_status=not_printed`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print Unprinted Guests
</a>
<a
href={`/events/${event_id}/badges/print_list`}
class="btn variant-filled-secondary"
>
<span class="fas fa-print mr-2"></span> Print All
</a>
</div>
</div>
<div class="flex flex-wrap justify-center gap-4 mt-4">
<a
href={`/events/${event_id}/templates`}
class="btn btn-tertiary"
>
<span class="fas fa-file-alt mr-2"></span> Manage Badge Templates
</a>
<a
href={`/events/${event_id}/badges/stats`}
class="btn btn-tertiary"
>
<span class="fas fa-chart-bar mr-2"></span> Badge Printing Stats
</a>
</div>
</div>
</details>
<details class="details">
<summary class="summary">Basic Info</summary>
<div class="p-4">
<Ae_comp_event_settings_basic_form
@@ -252,3 +324,33 @@
{:else}
<p>Loading event data...</p>
{/if}
{#if show_create_badge_modal}
<Modal bind:open={show_create_badge_modal}>
<div class="card p-4">
<h3 class="h3">Create New Badge</h3>
<Comp_badge_create_form
event_id={event_id}
on:success={() => {
show_create_badge_modal = false;
}}
on:cancel={() => (show_create_badge_modal = false)}
/>
</div>
</Modal>
{/if}
{#if show_upload_badge_modal}
<Modal bind:open={show_upload_badge_modal}>
<div class="card p-4">
<h3 class="h3">Upload Badges (CSV)</h3>
<Comp_badge_upload_form
event_id={event_id}
on:success={() => {
show_upload_badge_modal = false;
}}
on:cancel={() => (show_upload_badge_modal = false)}
/>
</div>
</Modal>
{/if}

View File

@@ -19,6 +19,7 @@
events__locations?: boolean; // event_id
// export let events__presenter_id: null|string = null; // event_presenter_id
events__reports?: boolean; // event_id
events__settings?: boolean; // event_id
events__session_id?: null | string; // event_session_id
events__session_search?: boolean; // event_id
}
@@ -31,6 +32,7 @@
events__location_id = null,
events__locations = false,
events__reports = false,
events__settings = false,
events__session_id = null,
events__session_search = false
}: Props = $props();
@@ -66,6 +68,14 @@
<span class="fas fa-map-marked-alt m-1"></span>
Locations
</a>
<a
href="/events/{event_id}/settings"
class="btn btn-sm mx-1 ae_btn_warning"
class:hidden={!events__settings}
>
<span class="fas fa-tools m-1"></span>
Admin Tools
</a>
</span>
<span

View File

@@ -20,7 +20,7 @@
// 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 { db_archives } from '$lib/ae_archives/db_archives';
import { db_archives, type Archive } from '$lib/ae_archives/db_archives';
import {
ae_snip,
ae_loc,

View File

@@ -229,32 +229,6 @@ Middle-click to open in new tab`}
</a>
{:else}
<!-- Edit Journal button. Creates a modal to edit the journal. -->
<!-- <button type="button"
onclick={() => {
tmp_journal_obj = {
name: $lq__journal_obj?.name,
description: $lq__journal_obj?.description,
type_code: $lq__journal_obj?.type_code,
passcode: $lq__journal_obj?.passcode,
passcode_timeout: $lq__journal_obj?.passcode_timeout,
auth_key: $lq__journal_obj?.auth_key,
cfg_json: $lq__journal_obj?.cfg_json
};
$journals_sess.show__modal_edit__journal_obj = true;
}}
class:hidden={!$ae_loc.edit_mode}
class="
btn btn-sm
variant-ghost-warning
hover:variant-filled-warning
transition
"
title="Edit Journal meta and configuration (name, type, passcode, categories, etc.: {$lq__journal_obj?.name})">
<Pencil />
<span class="hidden md:inline">
Edit Journal
</span>
</button> -->
<Journal_entry_obj_qry {log_lvl} {lq__journal_obj} />
{/if}

View File

@@ -193,7 +193,8 @@
{#if !$journals_sess?.journal_kv[$lq__journal_obj?.id]?.journal_passcode_verified}
<div class="flex gap-1">
<input
type="password"
autocomplete="off"
type="text"
bind:value={typed_journal_passcode}
placeholder="Passcode"
class="input input-sm variant-form-material w-32"