mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
- Replace hx-swap="none" with hx-target on response divs inside each of the three fieldsets (Restrictions d'accès, Degré d'ouverture, Types de travaux) - Add hxToastSuccess / hxToastError helpers in settings.php that return HTML toast fragments with self-referencing auto-dismiss after 3s - Each response div has aria-live="polite" for accessibility - Add comprehensive PHP/JS debugging logs: - settings.php logs raw POST values per field before resolving to 0/1 - checkboxes have hx-on::before-request and hx-on::after-request console.log - global htmx:beforeSend and htmx:sendError listeners in admin footer - toast lifecycle logged (creation + removal) for traceability - Fix toast auto-remove: use getElementById with random unique ID instead of querySelector which could remove wrong toast on rapid clicks - Follows the Django+HTMX ajax checkbox pattern from the reference tutorial feat(admin): add htmx toast feedback for settings checkboxes in contenus.php - Replace hx-swap="none" with hx-target on response divs inside each of the three fieldsets (Restrictions d'accès, Degré d'ouverture, Types de travaux) - Add hxToastSuccess / hxToastError helpers in settings.php that return HTML toast fragments with self-referencing auto-dismiss after 3s - Each response div has aria-live="polite" for accessibility - Add comprehensive PHP/JS debugging logs: - settings.php logs raw POST values per field before resolving to 0/1 - checkboxes have hx-on::before-request and hx-on::after-request console.log - global htmx:beforeSend and htmx:sendError listeners in admin footer - toast lifecycle logged (creation + removal) for traceability - Fix toast auto-remove: use getElementById with random unique ID instead of querySelector which could remove wrong toast on rapid clicks - Fix checkbox unresponsive after toggles: move hidden value="0" inputs outside <label> to prevent HTML label double-activation - Follows the Django+HTMX ajax checkbox pattern from the reference tutorial feat(admin): add htmx toast feedback for settings checkboxes in contenus.php - Replace hx-swap="none" with hx-target on response divs inside each of the three fieldsets (Restrictions d'accès, Degré d'ouverture, Types de travaux) - Add hxToastSuccess / hxToastError helpers in settings.php that return HTML toast fragments with self-referencing auto-dismiss after 3s - Each response div has aria-live="polite" for accessibility - Add comprehensive PHP/JS debugging logs: - settings.php logs raw POST values per field before resolving to 0/1 - checkboxes have hx-on::before-request and hx-on::after-request console.log - global htmx:beforeSend and htmx:sendError listeners in admin footer - toast lifecycle logged (creation + removal) for traceability - Fix toast auto-remove: use getElementById with random unique ID instead of querySelector which could remove wrong toast on rapid clicks - Fix checkbox unresponsive after toggles: remove hidden value="0" inputs entirely; unchecked checkboxes are simply absent from POST and server treats missing key as 0 outside <label> to prevent HTML label double-activation - Follows the Django+HTMX ajax checkbox pattern from the reference tutorial
2.7 KiB
2.7 KiB
TODO
HTMX Toast Feedback for Settings Checkboxes (contenus.php)
- Add
hx-targetresponse divs to the three fieldsets in contenus.php - Update settings.php to return HTML toast on HTMX requests
SQLite Backup & Data Integrity (docs/backup-plan.md)
Phase 1 — WAL Mode
- WAL mode already active (
PRAGMA journal_mode→wal) — set in Database constructor - Verify
-waland-shmsidecar files exist after writes - Verify nginx/PHP write access to sidecar files on server
- Add deploy-verify-permissions recipe that checks ownership, directory perms, file perms, and writability after rsync
- deploy recipe now uploads and runs deploy-server.sh to fix permissions, then verifies them
- deploy recipe now runs migrations (scripts/migrate.sh) after ensuring DB exists
- fix migrate.sh to detect server vs local layout (no app/ subdir on server)
- regenerate schema.sql from local DB via generate-schema.py (includes v_smtp_active, all 28 migrations)
- fix generate-schema.py to include v_smtp_active (was explicitly excluded)
Phase 2 — Audit Log
admin_audit_logtable already exists (migration 009),AdminLoggeralready writes to it- Create the
audit_logtable for data-level audit (before/after row snapshots) - Create
Audit.phphelper class - Instrument all DELETE, UPDATE, INSERT operations on core tables (theses, tags, languages, thesis_files)
- Verify by triggering a test delete and querying
SELECT * FROM audit_log ORDER BY id DESC LIMIT 5
Phase 3 — Soft Deletes
- Add
deleted_atcolumns tolanguages,tags,theses - Rebuild views
v_theses_fullandv_theses_publicwithdeleted_at IS NULLfilters - Update
schema.sqlfor fresh installs - Replace all hard DELETEs with soft deletes (
DELETE→UPDATE ... SET deleted_at = ...) - Add
deleted_at IS NULLto all SELECT queries touching these tables - Add admin "Corbeille" view for soft-deleted theses with Restore and Hard Delete actions
- Test each htmx-driven element (language search, tag search, repertoire filters) to confirm deleted entries don't appear
- Admin: add soft-deleted tags/languages view with restore option
Phase 4 — Hourly Snapshots via Cronjob
- Create
scripts/backup-sqlite.sh(hot backup viasqlite3 .backup, gzip, retention pruning) - Test locally — backup created, restores correctly
- Add
just backup-snapshotcommand for local ad-hoc backups - Deploy backup script to server (
/usr/local/bin/backup-sqlite.sh) - Create
/var/backups/xamxam/directory on server - Add cron jobs (hourly 30d + daily 90d)
- Test restore from production backup
Phase 5 — Remote Sync (for later)
- (Deferred)