mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
admin: semantic HTML pass — checkbox fieldset, landmarks, dl/dt, autocomplete, inline styles
checkbox-list.php partial:
- Replace outer <div>/<label> with <div>/<span class="admin-row-label"> + inner
<fieldset class="admin-checkbox-group"><legend class="sr-only"> to satisfy
WCAG 1.3.1 (group label for multi-checkbox rows without duplicating visible text)
- Replace <div class="admin-checkbox-list"> with <ul>; each checkbox wrapped in <li>
admin.css:
- Drop .admin-checkbox-list; add .admin-body fieldset.admin-checkbox-group rules
(border/padding reset so it doesn't inherit jury-fieldset box styling)
- Extend form-row label rule to span.admin-row-label
- .admin-inline-form + .admin-inline-form { margin-top:.35rem } replaces inline style
- .admin-input--inline / .admin-select--inline get width:160px (was inline style)
- .admin-tags-count + table th sizing via :has() replaces th inline styles
login.php: wrap content in <main id="main-content"> (missing landmark)
account.php:
- <div class="admin-account-status"> → <dl>; __label <span> → <dt>
- <div class="admin-danger-zone__description"> → <p>
index.php: <div class="admin-maintenance-bar"> → <aside role="status" aria-label="Statut du site">
add.php / edit.php: autocomplete="name" on author field, autocomplete="email" on
contact field (WCAG 1.3.5 / input purpose)
tags.php: all inline style= attributes removed (width, text-align, margin-top,
display:inline); all moved to CSS classes
This commit is contained in:
@@ -23,15 +23,17 @@ if (empty($_SESSION['csrf_token'])) {
|
||||
<?php include APP_ROOT . '/templates/partials/flash-messages.php'; ?>
|
||||
|
||||
<!-- Status info -->
|
||||
<div class="admin-account-status">
|
||||
<dl class="admin-account-status">
|
||||
<div class="admin-account-status__row">
|
||||
<span class="admin-account-status__label">Authentification PHP</span>
|
||||
<?php $badgeType = 'ok'; $badgeValue = $hasPassword; $badgeOkLabel = 'Active'; $badgeWarnLabel = 'Non configurée'; include APP_ROOT . '/templates/partials/status-badge.php'; ?>
|
||||
<dt class="admin-account-status__label">Authentification PHP</dt>
|
||||
<dd><?php $badgeType = 'ok'; $badgeValue = $hasPassword; $badgeOkLabel = 'Active'; $badgeWarnLabel = 'Non configurée'; include APP_ROOT . '/templates/partials/status-badge.php'; ?></dd>
|
||||
</div>
|
||||
<div class="admin-account-status__row">
|
||||
<span class="admin-account-status__label">Fichier de configuration</span>
|
||||
<code class="admin-account-status__code">config/admin_credentials.php</code>
|
||||
<?php $badgeType = 'ok'; $badgeValue = file_exists($credentialsFile); $badgeOkLabel = 'Présent'; $badgeWarnLabel = 'Absent'; include APP_ROOT . '/templates/partials/status-badge.php'; ?>
|
||||
<dt class="admin-account-status__label">Fichier de configuration</dt>
|
||||
<dd>
|
||||
<code class="admin-account-status__code">config/admin_credentials.php</code>
|
||||
<?php $badgeType = 'ok'; $badgeValue = file_exists($credentialsFile); $badgeOkLabel = 'Présent'; $badgeWarnLabel = 'Absent'; include APP_ROOT . '/templates/partials/status-badge.php'; ?>
|
||||
</dd>
|
||||
</div>
|
||||
<?php if (!$hasPassword): ?>
|
||||
<p class="admin-account-status__note">
|
||||
@@ -39,7 +41,7 @@ if (empty($_SESSION['csrf_token'])) {
|
||||
<code>config/admin_credentials.php</code> avec un hash bcrypt.
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<!-- Password change form -->
|
||||
<h2 class="admin-section-title"><?= $hasPassword ? 'Changer le mot de passe' : 'Définir le mot de passe' ?></h2>
|
||||
@@ -86,13 +88,13 @@ if (empty($_SESSION['csrf_token'])) {
|
||||
<!-- Danger zone: remove password -->
|
||||
<h2 class="admin-section-title admin-section-title--danger">Zone de danger</h2>
|
||||
<div class="admin-danger-zone">
|
||||
<div class="admin-danger-zone__description">
|
||||
<p class="admin-danger-zone__description">
|
||||
<strong>Supprimer la configuration du mot de passe PHP</strong><br>
|
||||
<small>
|
||||
Supprime <code>config/admin_credentials.php</code>. L'accès admin
|
||||
dépendra uniquement de l'authentification nginx Basic Auth si elle est configurée.
|
||||
</small>
|
||||
</div>
|
||||
</p>
|
||||
<form method="post" action="/admin/actions/account.php"
|
||||
onsubmit="return confirm('Supprimer le fichier de mot de passe PHP ? L\'accès admin ne sera protégé que par nginx Basic Auth.')">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
||||
|
||||
Reference in New Issue
Block a user