css: replace admin-form-row/admin-label/admin-input/select/textarea classes with semantic selectors

Remove five presentational classes from admin forms and replace with
structural CSS selectors scoped to .admin-form:

- .admin-form-row  → .admin-form > div:not(.admin-submit-wrap)
  Grid layout (260px label col + 1fr input col) applied directly to div
  children of the form; submit-wrap div excluded via :not().

- .admin-label     → .admin-form > div:not(.admin-submit-wrap) > label
  Scoped to the direct label child of each form row div; does not bleed
  into nested checkbox labels inside .admin-checkbox-list.

- .admin-input / .admin-select / .admin-textarea
  → .admin-form input:not([type=checkbox|radio|file|hidden|submit])
  → .admin-form select
  → .admin-form textarea
  Also extended to .admin-inline-form input/select (tags page) so the
  tags table inputs retain identical base styling and focus colour.

Templates updated: add.php, edit.php, login.php, account.php,
pages-edit.php, import.php, tags.php,
templates/partials/form/jury-fieldset.php — all class= attributes for
the five removed classes stripped.

import.php: added 'admin-form' class alongside 'admin-import-area' so
its single file-input row gets the grid row treatment; submit div was
already using admin-submit-wrap so it is correctly excluded.

No visual change — selectors target the same elements as before.
This commit is contained in:
Pontoporeia
2026-04-02 12:42:49 +02:00
parent e9e012376d
commit c8a3cc0ff2
10 changed files with 164 additions and 155 deletions

View File

@@ -53,48 +53,48 @@ function wasSelected($key, $value) {
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION["csrf_token"]) ?>">
<!-- Titre -->
<div class="admin-form-row">
<label class="admin-label" for="titre">Titre :</label>
<input class="admin-input" type="text" id="titre" name="titre"
<div>
<label for="titre">Titre :</label>
<input type="text" id="titre" name="titre"
value="<?= old('titre') ?>" required>
</div>
<!-- Sous-titre -->
<div class="admin-form-row">
<label class="admin-label" for="subtitle">Sous-titre (si applicable) :</label>
<input class="admin-input" type="text" id="subtitle" name="subtitle"
<div>
<label for="subtitle">Sous-titre (si applicable) :</label>
<input type="text" id="subtitle" name="subtitle"
value="<?= old('subtitle') ?>">
</div>
<!-- Auteur·ice -->
<div class="admin-form-row">
<label class="admin-label" for="auteurice">Auteur·ice(s) :</label>
<input class="admin-input" type="text" id="auteurice" name="auteurice"
<div>
<label for="auteurice">Auteur·ice(s) :</label>
<input type="text" id="auteurice" name="auteurice"
value="<?= old('auteurice') ?>" required>
</div>
<!-- Contact -->
<div class="admin-form-row">
<label class="admin-label" for="mail">Contact(s) (optionnel) [mail/site/insta/etc.] :</label>
<input class="admin-input" type="text" id="mail" name="mail"
<div>
<label for="mail">Contact(s) (optionnel) [mail/site/insta/etc.] :</label>
<input type="text" id="mail" name="mail"
value="<?= old('mail') ?>">
</div>
<?php require APP_ROOT . '/templates/partials/form/jury-fieldset.php'; ?>
<!-- Année -->
<div class="admin-form-row">
<label class="admin-label" for="année">Année :</label>
<input class="admin-input" type="number" id="année" name="année"
<div>
<label for="année">Année :</label>
<input type="number" id="année" name="année"
min="2000" max="<?= date('Y') + 1 ?>"
placeholder="<?= date('Y') ?>"
value="<?= old('année') ?>" required>
</div>
<!-- Orientation -->
<div class="admin-form-row">
<label class="admin-label" for="orientation">Orientation :</label>
<select class="admin-select" id="orientation" name="orientation" required>
<div>
<label for="orientation">Orientation :</label>
<select id="orientation" name="orientation" required>
<option value=""></option>
<?php foreach ($orientations as $o): ?>
<option value="<?= htmlspecialchars($o['id']) ?>"
@@ -106,9 +106,9 @@ function wasSelected($key, $value) {
</div>
<!-- AP -->
<div class="admin-form-row">
<label class="admin-label" for="ap">Atelier pluridisciplinaire :</label>
<select class="admin-select" id="ap" name="ap" required>
<div>
<label for="ap">Atelier pluridisciplinaire :</label>
<select id="ap" name="ap" required>
<option value=""></option>
<?php foreach ($apPrograms as $ap): ?>
<option value="<?= htmlspecialchars($ap['id']) ?>"
@@ -120,9 +120,9 @@ function wasSelected($key, $value) {
</div>
<!-- Finalité -->
<div class="admin-form-row">
<label class="admin-label" for="finality">Finalité du master :</label>
<select class="admin-select" id="finality" name="finality" required>
<div>
<label for="finality">Finalité du master :</label>
<select id="finality" name="finality" required>
<option value=""></option>
<?php foreach ($finalityTypes as $f): ?>
<option value="<?= htmlspecialchars($f['id']) ?>"
@@ -134,8 +134,8 @@ function wasSelected($key, $value) {
</div>
<!-- Langue(s) -->
<div class="admin-form-row">
<label class="admin-label">Langue(s) :</label>
<div>
<label>Langue(s) :</label>
<div class="admin-checkbox-list">
<?php foreach ($languages as $lang): ?>
<label class="admin-checkbox-label">
@@ -149,8 +149,8 @@ function wasSelected($key, $value) {
</div>
<!-- Format(s) -->
<div class="admin-form-row">
<label class="admin-label">Format(s) :</label>
<div>
<label>Format(s) :</label>
<div class="admin-checkbox-list">
<?php foreach ($formatTypes as $fmt): ?>
<label class="admin-checkbox-label">
@@ -164,10 +164,10 @@ function wasSelected($key, $value) {
</div>
<!-- Mots-clés -->
<div class="admin-form-row">
<label class="admin-label" for="tag">Mots-clés :</label>
<div>
<label for="tag">Mots-clés :</label>
<div>
<input class="admin-input" type="text" id="tag" name="tag"
<input type="text" id="tag" name="tag"
placeholder="sociologie, anthropologie, ..."
value="<?= old('tag') ?>">
<small>Séparez par des virgules. Max 10 mots-clés.</small>
@@ -175,16 +175,16 @@ function wasSelected($key, $value) {
</div>
<!-- Synopsis -->
<div class="admin-form-row">
<label class="admin-label" for="synopsis">Synopsis :</label>
<textarea class="admin-textarea" id="synopsis" name="synopsis"
<div>
<label for="synopsis">Synopsis :</label>
<textarea id="synopsis" name="synopsis"
rows="7" required><?= old('synopsis') ?></textarea>
</div>
<!-- Licence -->
<div class="admin-form-row">
<label class="admin-label" for="license_id">Licence :</label>
<select class="admin-select" id="license_id" name="license_id">
<div>
<label for="license_id">Licence :</label>
<select id="license_id" name="license_id">
<option value="">— Inconnue —</option>
<?php foreach ($licenseTypes as $lt): ?>
<option value="<?= htmlspecialchars($lt['id']) ?>"
@@ -196,10 +196,10 @@ function wasSelected($key, $value) {
</div>
<!-- Durée/Taille -->
<div class="admin-form-row">
<label class="admin-label" for="duration_info">Durée / Taille :</label>
<div>
<label for="duration_info">Durée / Taille :</label>
<div>
<input class="admin-input" type="text" id="duration_info" name="duration_info"
<input type="text" id="duration_info" name="duration_info"
placeholder="Ex : 84 pages"
value="<?= old('duration_info') ?>">
<small>Durée (minutes) ou nombre de pages.</small>
@@ -207,16 +207,16 @@ function wasSelected($key, $value) {
</div>
<!-- Lien -->
<div class="admin-form-row">
<label class="admin-label" for="lien">Lien (site / ressource) :</label>
<input class="admin-input" type="url" id="lien" name="lien"
<div>
<label for="lien">Lien (site / ressource) :</label>
<input type="url" id="lien" name="lien"
placeholder="https://..."
value="<?= old('lien') ?>">
</div>
<!-- Image couverture -->
<div class="admin-form-row">
<label class="admin-label">Image de couverture :</label>
<div>
<label>Image de couverture :</label>
<div class="admin-file-input">
<input type="file" id="couverture" name="couverture" accept="image/jpeg,image/png">
<small>JPG, PNG. Taille max : 10 MB.</small>
@@ -224,8 +224,8 @@ function wasSelected($key, $value) {
</div>
<!-- Image bannière -->
<div class="admin-form-row">
<label class="admin-label">Image bannière (accueil) :</label>
<div>
<label>Image bannière (accueil) :</label>
<div class="admin-file-input">
<input type="file" id="banner" name="banner" accept="image/jpeg,image/png,image/webp">
<small>JPG, PNG ou WEBP. Format paysage recommandé (4:1). Max 5 MB.</small>
@@ -233,8 +233,8 @@ function wasSelected($key, $value) {
</div>
<!-- Fichiers -->
<div class="admin-form-row">
<label class="admin-label">Fichiers du TFE :</label>
<div>
<label>Fichiers du TFE :</label>
<div class="admin-file-input">
<input type="file" id="files" name="files[]" multiple
accept=".pdf,.jpg,.jpeg,.png,.mp4,.zip">