Commit Graph

237 Commits

Author SHA1 Message Date
Théophile Gervreau-Mercier
88b9f341cd Replace Posterg branding with XAMXAM in all user-facing content 2026-04-27 19:30:54 +02:00
Théophile Gervreau-Mercier
7e26351f4b refactor: remove test.db, use only posterg.db for all environments
- Simplified Database.php determineDatabasePath to always use posterg.db
- Removed test.db auto-detection based on php_sapi_name
- Removed test.db targets from justfile (migrate-test removed)
- Removed CreateTestDatabase.php fixture script
- Updated migrate.sh to only init posterg.db
- Updated setup-dev.sh to init posterg.db
- Updated run-tests.php (removed DB_ENV=test env var)
- Updated deploy-db to use posterg.db
- Removed test.db file

refactor: remove empty fixtures directory
2026-04-27 18:07:20 +02:00
Théophile Gervreau-Mercier
780105eec0 Fix storage/cache ignore path and untrack cache files 2026-04-25 19:38:51 +02:00
Pontoporeia
54ef24d21f ignore *.db files, fix thesis identifier to use max seq instead of count, untrack .db files 2026-04-24 23:03:49 +02:00
Pontoporeia
4986fa74f4 add structured logging for admin/partage form submissions + migration system
- AppLogger: JSON-line logger in storage/logs/form-submissions.log
- Logs submissions (admin + partage) with IP, UA, thesis ID, author
- Logs errors with context (post keys, share slug)
- Migration runner (app/migrations/run.php) handles schema drift
- 001_add_objet_column.sql fixes production DB missing 'objet' column
- ThesisCreateController::getIdentifier() helper for logging
2026-04-24 23:03:49 +02:00
Pontoporeia
decb9e2907 fix: replace mb_strlen/mb_substr in student-preview.php (mbstring unavailable) 2026-04-24 23:03:49 +02:00
Pontoporeia
9b4cb52617 fix: replace mb_strtolower with strtolower in admin import (mbstring unavailable in php8.4-fpm) 2026-04-24 23:03:49 +02:00
Pontoporeia
e590d8e035 perf: pre-render student popover cards server-side into <template> tags — zero per-hover requests 2026-04-24 23:03:49 +02:00
Pontoporeia
ede53746ba feat: student name popover preview on /repertoire via htmx 2026-04-24 23:03:49 +02:00
Pontoporeia
d961f9533c feat: add objet field (tfe/thèse/frart) with share-link restriction and site-settings toggles 2026-04-24 23:03:49 +02:00
Pontoporeia
dbaabaf8a0 merge all migrations into schema.sql 2026-04-24 23:03:49 +02:00
Pontoporeia
38031374c1 fix(partage): smtp view missing in schema + thanks redirect broken
- Add v_smtp_active VIEW to schema.sql (was only in migration 012,
  causing SmtpRelay::isConfigured() to always return false on fresh installs)
- Change thanks redirect from /partage/thanks.php to /partage/thanks
  (nginx 'location ~ \.php$ { deny all }' blocked the .php URL)
- Route /partage/thanks in index.php before slug validation
- Guard App::boot() in thanks.php to avoid double-boot when included
2026-04-24 23:03:49 +02:00
Pontoporeia
95bce2bbad Extract form CSS into form.css; scope system.css to system.php only 2026-04-24 23:03:49 +02:00
Pontoporeia
d82556c596 Unify form CSS: move licence/share-badge styles to admin.css, remove inline style from partage form 2026-04-24 23:03:49 +02:00
Pontoporeia
a3849a8e69 SmtpRelay: replace mail() stub with native socket SMTP client 2026-04-24 23:03:49 +02:00
Pontoporeia
b448d0d40c Lock body scroll: only main/inner elements scroll on admin and public pages 2026-04-24 23:03:49 +02:00
Pontoporeia
5a58eefe66 feat(admin): add SMTP test email button on parametres page 2026-04-24 23:03:49 +02:00
Pontoporeia
4839b568de Separate admin views from controllers — move HTML to templates/admin/
All admin pages refactored to thin controllers + pure view templates, mirroring
the public-page pattern:

Controllers (public/admin/*.php): auth, data loading, include template
Views (templates/admin/*.php): pure HTML/PHP output
Fragment partials (templates/admin/partials/): toast, system-log-panel, system-nginx-config-panel

Pages migrated: login, tags, contenus, contenus-edit, account, acces-etudiante,
thanks, add, edit, parametres, system, index

Fragment endpoints refactored: system-fragment.php, toast-fragment.php
Skipped (pure redirects): logout, logs, status, import
2026-04-24 23:03:49 +02:00
Pontoporeia
362688c0fa fix: remove broken flash-messages include from admin footer; make repertoire columns scrollable 2026-04-24 23:03:49 +02:00
Pontoporeia
19ef2a11dc fix CSV importer AP/orientation name resolution + seed missing AP programs
- migration 014: adds Récits et expérimentation (RE), PACS, sets code NS
  on Narration Spéculative; applied to both posterg.db and test.db

- importer (admin/index.php): replaced the code-only ap_programs lookup
  (SELECT WHERE code=?) and the orientationMap short-code translation with
  two resolver closures that handle the real CSV format (full names):

  resolveAP(): alias map for L.I.E.N.S., case variants → exact name
  match → code match (legacy) → case-insensitive name match

  resolveOrientation(): legacy 2-letter code map → alias map for
  Installation/Performance, Arts numériques, Design numérique →
  exact name match → case-insensitive name match

  All 5 AP values and 13 orientation values from the real CSV now
  resolve to correct DB IDs. Legacy short-code CSVs (test.db format)
  continue to work unchanged.
2026-04-24 23:03:49 +02:00
Pontoporeia
73fdda4a7f fix repertoire AP/OR/FI columns and main scroll containment
- repertoire-index.php: add $colHasMatches per-column guard.
  Entries in a column are only faded when that column has at least one
  matched entry in the current result set. When a dimension has no
  matched entries (e.g. no thesis has orientation_id set yet), the
  entire column stays fully interactive — all values remain clickable.
  This fixes: empty columns, forced single-select, cascade fading.

- Database.php: revert allAp/allOr/allFi to full lookup-table queries
  so all known values are always shown (not just ones linked to theses).

- common.css: body is now a flex column; main gets flex:1 + min-height:0;
  header-search-wrap gets flex-shrink:0; duplicate html/body blocks merged.
- public.css: removed redundant top-level main block; home-main gets min-height:0.
- repertoire.css: search-main gets min-height:0 for proper flex scroll.
2026-04-24 23:03:49 +02:00
Pontoporeia
78449afe64 some css changes 2026-04-24 23:01:25 +02:00
Pontoporeia
1b02ccb1d5 fix: mark languages as required, add required-field visual indicators on both forms
- checkbox-list.php: support $required prop → adds required + aria-required on fieldset
- add.php: languages checkbox now marked required (matches server-side validation)
- partage/index.php: same for student form
- admin.css: dashed border on required inputs, bold labels, red asterisk via :has(), "Champs obligatoires" note
- Both forms now show "* Champs obligatoires" note at top

Server-side required fields = titre, auteurice, synopsis, année, orientation, ap, finality, languages (≥1), access_type_id, confirmation_email. All now have required attribute + visual asterisk.
2026-04-20 16:19:55 +02:00
Pontoporeia
e21a4d81a2 refine: required confirmation_email field on both student forms, StudentEmail uses it directly
- Add dedicated 'confirmation_email' (type=email, required) field
  to student form at end of submission (partage + admin).
- ThesisCreateController now validates it is present and a valid
  email; form is rejected if missing/invalid.
- Autofocus mapping for confirmation_email errors.
- StudentEmail uses confirmation_email directly (removed extractEmail
  hack that mined email from free-form contact field).
2026-04-20 15:47:55 +02:00
Pontoporeia
fa75ca4a65 fix: inline getDatabasePath into Database.php, delete config/config.php
- Remove require_once for config/config.php (file was never deployed — outside app/)
- Inline DB path resolution directly in Database::determineDatabasePath()
- Uses APP_ROOT when defined (bootstrap already loaded), falls back to __DIR__/../
- DB_ENV=test|prod env-var override preserved for tests
- php -S cli-server -> test.db, nginx/fpm -> posterg.db
2026-04-20 14:23:30 +02:00
Pontoporeia
de2e7a61ee feat: single entry point routing — convert to front controller pattern
- Create app/public/index.php as front controller (bootstrap + Dispatcher)
- Rewrite app/router.php for PHP dev server → all non-asset requests to index.php
- Update Dispatcher to render full page layouts (head+header+view+footer)
- Move public view templates into templates/public/ (home, search, tfe, about, repertoire)
- Delete dead direct-access public/*.php files (apropos, search, tfe, licence, repertoire)
- Add clean URL routes to Dispatcher (/search, /tfe, /repertoire, /apropos, /licence, /media)
- Remove .php extensions from all internal links (header, views, templates, URLs)
- Update OG tags in controllers to use clean URLs
- Update nginx posterg.conf → front-controller try_files pattern, block direct .php access
- Update header.php and search-bar.php form actions to clean URLs
- Switch AboutController nav key from 'nav' to 'currentNav' for consistency
2026-04-20 12:42:15 +02:00
Pontoporeia
75f808bee4 feat: extract MediaController, wire into Dispatcher, delete media.php 2026-04-20 12:32:00 +02:00
Pontoporeia
b03be51b92 feat: migrate admin system page to HTMX with tab-based navigation and log viewer 2026-04-16 15:03:40 +02:00
Pontoporeia
bf30aab0b3 migrate apropos data from config/apropos.php to SQLite
- Create apropos_contents table via migration 010
- Add Database methods: getAproposContent(), saveAproposContent(), getAllAproposContents()
- Replace admin/pages.php with admin/contenus.php (renamed header from 'Pages statiques' to 'Contenus')
- Replace admin/pages-edit.php with admin/contenus-edit.php (support editing pages + apropos contents)
- Create admin/actions/apropos.php for saving apropos data (contacts, credits, erg_url)
- Update public/apropos.php to read contacts/credits/erg_url from DB
- Delete config/apropos.php
2026-04-16 14:22:41 +02:00
Pontoporeia
e70a65ffb6 fix: session boot on POST path, consolidate rate limiter via checkKey() 2026-04-16 13:07:16 +02:00
Pontoporeia
a6df3c8c0e fix: /partage/<slug> routing (regex delimiter + nginx location) 2026-04-16 13:07:16 +02:00
Pontoporeia
b7be93e30b Security: rate limiting and flash messaging for partage share links
- Add rate limiting (5 submissions per IP per 10 min, per share link)
  to prevent abuse of shared submission endpoints
- Replace all plain die() error responses with styled flash messages
  and redirects (invalid slug, disabled link, expired link, wrong password,
  rate limit exceeded, CSRF failure)
- Add dedicated error page renderer for disabled/expired links with
  home page link
- Password gate now uses flash message via session redirect instead
  of inline error variable
2026-04-16 13:07:16 +02:00
Pontoporeia
150099dc3c admin: replace header 'Ajouter un TFE' nav link with toolbar button 2026-04-16 13:07:16 +02:00
Pontoporeia
f4aba500e6 feat: student mode support for thanks page (admin-auth only)
- add hidden student_mode field in add.php form
- pass mode=student through redirect to thanks.php in formulaire.php
- thanks.php renders clean student thank-you page (no header, centered button)
- add CSS for .thanks-student-page, .btn-new-form, .thanks-success, .thanks-error
- admin auth always required; student mode is purely UI variant on the physical machine
2026-04-15 14:24:44 +02:00
Pontoporeia
150b5b1dac admin/add: add ?mode=student toggle — hides admin header, keeps auth 2026-04-15 14:24:44 +02:00
Pontoporeia
0eb2e310f4 admin/parametres: cleanup page — remove card syntax, use semantic HTML (checkboxes/fieldsets), move delete-all-TFE danger zone into maintenance 2026-04-15 14:24:44 +02:00
Pontoporeia
fd4fb5ce4a Add delete/batch-delete and sortable columns to admin list
- Database: add deleteThesis() and bulkDeleteTheses() methods with file cleanup
- Database: add SORT_MAP + buildOrderBy() for safe column sorting
- Database: getThesesList() now respects sort/dir filter params
- New action: actions/delete.php (single + batch delete with CSRF)
- Admin index: delete button per row with confirmation dialog
- Admin index: batch 'Supprimer' button in bulk actions bar
- Admin index: sortable column headers (ID, Titre, Année, Orientation, AP, Statut)
- Admin index: sort state preserved in pagination links
- CSS: admin-btn-delete (red muted), admin-sort-link styles
2026-04-15 14:24:44 +02:00
Pontoporeia
0cb4451218 formulaire: default interne, unpublished, contact toggle, settings section 2026-04-15 14:24:44 +02:00
Pontoporeia
67a4aaac26 Fix nginx deduplication: remove nginx/scripts/ entirely, fix README typos and dead references 2026-04-15 14:24:44 +02:00
Pontoporeia
507f3eb704 Consolidate nginx docs and scripts, update paths 2026-04-15 14:24:44 +02:00
Pontoporeia
a13e73aed3 Replace random HSL gradients in homepage cards with header gradient 2026-04-09 14:29:17 +02:00
Pontoporeia
424f79c819 typography: switch display font from Combined to Ductus 2026-04-08 18:09:35 +02:00
Pontoporeia
a333a5fdad Rebrand: replace PostErg with XAMXAM in admin header link, default title, and OG site_name 2026-04-08 18:04:35 +02:00
Pontoporeia
18045af243 favicon: replace SVG placeholder with full PNG/ICO set from assets/favicon/ 2026-04-08 18:01:41 +02:00
Pontoporeia
d68645f1b1 style: retheme system page to site light palette — remove dark --sys-* tokens 2026-04-08 17:49:50 +02:00
Pontoporeia
df414346e9 fix: SystemController php-fpm detection — probe phpX.Y-fpm from running PHP version first 2026-04-08 17:46:42 +02:00
Pontoporeia
7117934d07 fix: replace mb_strlen/mb_substr with strlen/substr — mbstring not available on prod 2026-04-08 17:42:01 +02:00
Pontoporeia
4199b206db Move CSV import to inline dialog on list page 2026-04-08 15:16:10 +02:00
Pontoporeia
603af07b68 Add Paramètres page: consolidate maintenance + account settings 2026-04-08 15:06:51 +02:00
Pontoporeia
ba135f0cb5 fix: replace 'Xamxam' with 'Posterg' in public nav header 2026-04-08 14:14:37 +02:00