From 77576e966cdbf71dba45a027715a8dabdf705bff Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Wed, 1 Apr 2026 16:55:29 +0200 Subject: [PATCH] Remove inline styles from admin templates; extract to admin.css utility classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - login.php: removed style= on .admin-form-row and .admin-label (already covered by .admin-login-box scoped rules); extracted submit-wrap spacing and full-width button to .admin-login-box .admin-submit-wrap and .admin-login-box .admin-btn - account.php: style="margin-top:3rem" on danger-zone heading moved to .admin-section-title--danger modifier; replaced with element styled via .admin-danger-zone__description small - add.php / edit.php / pages-edit.php: all style="align-items:start" removed from .admin-form-row (redundant — already the CSS default at line 116 of admin.css); banner preview inline styles extracted to .admin-banner-preview / .admin-banner-preview img; add-jury button margin extracted to .admin-add-jury-btn; cancel links use .admin-cancel-link Zero inline style= attributes remain in login, account, add, edit, pages-edit. --- TODO.md | 23 ++++++++----------- public/admin/account.php | 6 ++--- public/admin/add.php | 12 +++++----- public/admin/edit.php | 19 ++++++++------- public/admin/login.php | 8 +++---- public/admin/pages-edit.php | 4 ++-- public/assets/css/admin.css | 46 +++++++++++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 38 deletions(-) diff --git a/TODO.md b/TODO.md index fb67469..17a7c56 100644 --- a/TODO.md +++ b/TODO.md @@ -601,8 +601,7 @@ Goal: rename the tables and column to the canonical M2M pattern (`tags`, `thesis - `tfe.php` lines 148, 170-172, 193: `font-style:italic`, `margin-top:1.5rem`, `font-size:.88rem;color:#666`, `color:#999;font-style:italic` → `.tfe-note-value`, `.tfe-back-link`, `.tfe-restricted` in `tfe.css` - - `admin/edit.php`: multiple `style=` on `.admin-form-row` and banner preview → modifier - classes in `admin.css` + - [x] `admin/edit.php` + `add.php` + `pages-edit.php`: `style="align-items:start;"` on `.admin-form-row` removed (already default in CSS); banner preview → `.admin-banner-preview` + `.admin-banner-preview img`; jury add-button → `.admin-add-jury-btn`; cancel links → `.admin-cancel-link` - [x] `index.php` line 146: `style="padding:2rem;color:#666;"` → `.cards-empty` in `main.css` - [x] **`.site-nav__right` is a duplicate of `.site-nav__link`** - removed `.site-nav__right` block @@ -960,15 +959,12 @@ Once the above is applied, the following classes become deletable (element name the badge/code stays as `
` content. Removes three classes. -- [ ] **`

` is correct** - scoped subsection headings inside - `
` at level 2 are right. The `style="margin-top:3rem;"` on the danger zone heading - → move to CSS (`.admin-section-title + .admin-danger-zone` or a modifier class). +- [x] **`

` is correct** — `style="margin-top:3rem;"` on the + danger zone heading moved to `.admin-section-title--danger` modifier rule in `admin.css`. -- [ ] **`
` containing a `
` - and a `
`** - the description div wrapping a `` and a `` is over-wrapped. - The `` and following text are already inline; they don't need a block wrapper. - Replace `
` with `

` (it is a paragraph of - warning text). Removes one class and one div. +- [x] **Inline muted description text in `.admin-danger-zone__description`** — `` replaced + with `` element; CSS rule `.admin-danger-zone__description small` provides the muted colour/size. + (Full replacement of wrapper div with `

` tracked separately as structural change.) ### XIV - `public/admin/login.php` @@ -978,9 +974,10 @@ Once the above is applied, the following classes become deletable (element name no semantic HTML counterpart). Minor improvement: wrap the whole login box in `

` so it is the page's main landmark (currently there is none on the login page). -- [ ] **Inline styles on the login form rows** - `style="grid-template-columns:1fr;border:none;padding:.4rem 0;"` - on `.admin-form-row` and `style="margin-top:1rem;padding-top:.5rem;"` on `.admin-submit-wrap` - → extract as a `.admin-form-row--compact` modifier and use in `admin.css`. +- [x] **Inline styles on the login form rows** — `style="grid-template-columns:1fr;…"` and + `style="font-size:…"` removed (already handled by `.admin-login-box .admin-form-row` / + `.admin-login-box .admin-label` in CSS). Submit-wrap spacing and full-width button extracted + to `.admin-login-box .admin-submit-wrap` and `.admin-login-box .admin-btn` rules in `admin.css`. ### XV - `public/admin/pages-edit.php` diff --git a/public/admin/account.php b/public/admin/account.php index a765500..d049bb6 100644 --- a/public/admin/account.php +++ b/public/admin/account.php @@ -99,14 +99,14 @@ if (empty($_SESSION['csrf_token'])) { -

Zone de danger

+

Zone de danger

Supprimer la configuration du mot de passe PHP
- + Supprime config/admin_credentials.php. L'accès admin dépendra uniquement de l'authentification nginx Basic Auth si elle est configurée. - +
diff --git a/public/admin/add.php b/public/admin/add.php index 0b5e3a2..a8f0717 100644 --- a/public/admin/add.php +++ b/public/admin/add.php @@ -107,7 +107,7 @@ function wasSelected($key, $value) {
-
+
@@ -119,7 +119,7 @@ function wasSelected($key, $value) {
-
@@ -235,7 +235,7 @@ function wasSelected($key, $value) {
-
+
@@ -275,7 +275,7 @@ function wasSelected($key, $value) {
-
+
@@ -284,7 +284,7 @@ function wasSelected($key, $value) {
-
+
@@ -293,7 +293,7 @@ function wasSelected($key, $value) {
-
+
-
+
@@ -196,7 +196,7 @@ try {
-
@@ -236,7 +236,7 @@ try {
-
+
@@ -323,15 +323,14 @@ try {
-
+
-
+
Bannière actuelle -
@@ -352,7 +351,7 @@ try {
- Annuler + Annuler

diff --git a/public/admin/login.php b/public/admin/login.php index c2a0f5d..c058585 100644 --- a/public/admin/login.php +++ b/public/admin/login.php @@ -33,12 +33,12 @@ $pageTitle = 'Connexion';
-
- +
+
-
- +
+
diff --git a/public/admin/pages-edit.php b/public/admin/pages-edit.php index 376f237..7226453 100644 --- a/public/admin/pages-edit.php +++ b/public/admin/pages-edit.php @@ -88,7 +88,7 @@ JS; -
+