diff --git a/TODO.md b/TODO.md index d2be754..8e2c001 100644 --- a/TODO.md +++ b/TODO.md @@ -99,3 +99,1301 @@ The admin system page (`/admin/system.php`) runs expensive operations on every l - `admin.css`: `.admin-nav` → `.admin-body header nav`, logout via `[data-nav-logout]` attribute - [x] PHP vs Flask architecture analysis (`ANALYSIS_PHP_VS_FLASK.md`) - [x] Refactoring recommendations for controller/template separation (`REFACTORING_RECOMMENDATIONS.md`) + +--- + +# Historical TODO (pre-2026-03-31 — recovered from commit kkmmrrrkkyrs) + + +## Styling Redesign (matching design images) + +- [x] Redesign shared nav bar (purple gradient top, flat, POSTERG / RÉPERTOIRE / À PROPOS) +- [x] Redesign shared search bar (full-width, icon, bottom border only, white bg) +- [x] Rewrite `common.css` (nav + search bar components) +- [x] Rewrite `main.css` (home page - white bg, media card grid, label below) +- [x] Rewrite `search.css` (répertoire index - 4-col ANNÉES/CATÉGORIES/ÉTUDIANTES/MOTS-CLÉS) +- [x] Rewrite `tfe.css` (TFE page - 2-col, large author/title left, media right) +- [x] Add `apropos.css` (À Propos - 2-col, large monospace text) +- [x] Rewrite `admin.css` (dark bg, purple gradient nav, bottom-border-only form inputs) +- [x] Update `templates/nav.php` (new shared nav partial) +- [x] Update `templates/search-bar.php` (new shared search bar partial) +- [x] Rewrite `public/index.php` (home page with new layout) +- [x] Rewrite `public/search.php` (répertoire index view + search results view) +- [x] Rewrite `public/tfe.php` (individual TFE page) +- [x] Create `public/apropos.php` (À Propos page) +- [x] Rewrite `templates/admin/head.php` (admin nav) +- [x] Rewrite `templates/admin/footer.php` (clean close) +- [x] Rewrite `public/admin/add.php` (form with row layout) +- [x] Rewrite `public/admin/index.php` (dark table) +- [x] Rewrite `public/admin/edit.php` (form with row layout) +- [x] Rewrite `public/admin/login.php` (centered dark login box) +- [x] Rewrite `public/admin/thanks.php` (dark info cards) +- [x] Rewrite `public/admin/import.php` (clean dark form) + +## Justfile / Ops + +- [x] Simplify `serve` and `deploy` to one recipe each +- [x] Remove sysadmin recipes (server-logs, server-status, deploy-nginx, deploy-admin-tools) +- [x] Extract server scripts to `scripts/` (deploy-server.sh, manage-admin-users.sh) +- [x] Guard `deploy-db` against overwriting existing remote database +- [x] Update README.md and docs/SERVER_SETUP.md to reflect current structure + +--- + +## Analysis / Reports + +- [x] ORM assessment written → `docs/ORM_ASSESSMENT.md` + +--- + +## NEW FEATURES + +### 1 - License page (public) + +Create a public-facing `/licence.php` page, styled consistently with `apropos.php`. + +- [x] **`public/licence.php`** - new public page; fetches content from `pages` table + (slug `'licenses'`); renders with Parsedown Markdown; uses `apropos.css` layout +- [x] **`templates/nav.php`** - add "Licence" link between "Répertoire" and "À Propos"; + apply `site-nav__link--active` when `$currentNav === 'licence'` +- [x] The `pages` table row for slug `'licenses'` verified in live DB + +--- + +### 2 - Admin: WYSIWYG/Markdown editors for static pages + +Allow admins to edit the content of the "À propos" and "Licence" pages from the admin +panel, stored in the existing `pages` table. + +#### 2a - `src/Database.php` + +- [x] `getPage(string $slug): array|null` - `SELECT * FROM pages WHERE slug = ?` +- [x] `savePage(string $slug, string $content): void` - throws if slug not found +- [x] `getAllPages(): array` - for listing in admin + +#### 2b - Admin pages editor UI + +- [x] **`public/admin/pages.php`** - list all editable pages; links to edit each one +- [x] **`public/admin/pages-edit.php`** - EasyMDE WYSIWYG Markdown editor via CDN + +#### 2c - `public/admin/actions/page.php` + +- [x] Auth guard + CSRF check + slug validation + length validation + savePage + redirect + +#### 2d - Public pages render Markdown + +- [x] **`public/apropos.php`** - renders `$db->getPage('about')` via Parsedown (bundled `src/Parsedown.php`) +- [x] **`public/licence.php`** - renders `$db->getPage('licenses')` via Parsedown +- [x] Parsedown bundled as `src/Parsedown.php` (zero-dependency, MIT) + +#### 2e - Nav links in admin + +- [x] **`templates/admin/head.php`** - "Pages statiques" nav item added + +--- + +### 3 - License field on TFE forms + +Add a "Licence" dropdown to the Add and Edit TFE forms. The `license_types` table +already exists in the schema with an `id`, `name`, `description` structure but has +no seed data yet. + +#### 3a - Schema / DB + +- [x] **`storage/schema.sql`** - seed `INSERT OR IGNORE` for 8 CC licence types added +- [x] **`storage/migrations/003_seed_license_types.sql`** - migration created + applied +- [x] Verified live DB has `license_types` with 8 rows + +#### 3b - `src/Database.php` + +- [x] `getLicenseTypes(): array` +- [x] `getAllLicenseTypes(): array` - alias + +#### 3c - Add form (`public/admin/add.php`) + +- [x] Loads `$licenseTypes`; "Licence" `` should have an associated + `