mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
- Updated 6 admin templates: add.php, edit.php, login.php, account.php,
import.php, pages-edit.php — replaced <div class="admin-submit-wrap">
with <div class="admin-form-footer">
- Updated 8 CSS selectors in admin.css:
- .admin-form-footer { margin-top/padding-top } (was .admin-submit-wrap)
- .admin-form > div:not(.admin-form-footer) grid exclusion guard (×3)
- .admin-login-box .admin-form > div:not(.admin-form-footer) overrides (×2)
- .admin-login-box .admin-form-footer compact spacing override
- No visual change; purely a semantic rename to a descriptive class name
- Also marked status-badge.php partial and WCAG 1.3.1 badge tasks as
already-done in todo/02-php-components.md and todo/04-accessibility.md
(partial + CSS were fully implemented but todo had not been updated)
32 lines
2.7 KiB
Markdown
32 lines
2.7 KiB
Markdown
# PHP Components (Reusable Partials)
|
|
|
|
## Form field partials — `templates/partials/form/`
|
|
|
|
- [ ] **`text-field.php`** — accepts `$name`, `$label`, `$value`, `$required`, `$placeholder`, `$hint`; renders the `<div>…<label>…<input>…<small>` pattern used ~15 times across `add.php` and `edit.php`
|
|
- [ ] **`select-field.php`** — accepts `$name`, `$label`, `$options[]`, `$selected`, `$required`; renders `<div>…<label>…<select>…</div>` pattern used ~6 times
|
|
- [ ] **`checkbox-list.php`** — accepts `$name`, `$label`, `$options[]`, `$checked[]`; renders the checkbox group pattern (languages, formats) used ~4 times across `add.php` and `edit.php`
|
|
- [ ] **`file-field.php`** — accepts `$name`, `$label`, `$accept`, `$hint`, `$multiple`; renders file input pattern used 3 times
|
|
- [ ] **`jury-fieldset.php`** — entire jury composition fieldset + JS duplicated verbatim between `add.php` and `edit.php`; extract into one partial accepting `$juryPresident`, `$juryPromoteur`, `$juryPromoteurExt`, `$juryLecteurs[]`
|
|
|
|
## Shared UI partials — `templates/partials/`
|
|
|
|
- [x] **`pagination.php`** — partial created and used in both `search.php` and (now) `admin/index.php`; `admin/index.php` also gained proper server-side pagination (25/page) with filter-aware `$baseParams`
|
|
- [x] **`status-badge.php`** — partial fully implemented (`templates/partials/status-badge.php`) with `$badgeType`/`$badgeValue` API; CSS rules in `admin.css`; used in `admin/index.php` for publish + access badges
|
|
- [ ] **`admin-alert.php`** — rename/merge `flash-messages.php` to also handle the 3 different legacy flash key patterns (`$_SESSION['error']`, `$_SESSION['admin_error']`, `$_SESSION['edit_error']`, etc.) that pages still consume manually instead of via `App::consumeFlash()`
|
|
|
|
## Controller Extraction (In Progress)
|
|
|
|
- [ ] Extract `SearchController` — most complex public page
|
|
- [ ] Extract `SystemController` — biggest single-file win, 500→8 lines
|
|
- [ ] Extract `ThesisEditController` — merges `edit.php` + `actions/edit.php`, deduplicates jury fieldset
|
|
- [ ] Extract remaining controllers one by one
|
|
- [ ] Consolidate action handlers into controller methods
|
|
- [ ] Unify flash message keys project-wide to `_flash_error` / `_flash_success`
|
|
- [ ] Move OG tag construction into controller logic
|
|
- [ ] Extract inline CSS/JS from `system.php` into separate assets
|
|
|
|
## Backend Maintenance
|
|
|
|
- [ ] **`RateLimit` uses per-file JSON on disk** — consider switching to APCu or SQLite; at minimum move cache dir to `/tmp` or `storage/cache/` excluded from deploy rsync
|
|
- [ ] **`apropos.php` contacts and credits are hardcoded** — names, roles, emails (Laurent Leprince, Xavier Gorgol, Brigitte Ledune) live in PHP/HTML; move into the `about` page Markdown or a config array
|