mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
Replace four presentational class names in admin.css with structural selectors
that target native HTML elements already present in every admin template:
.admin-main → .admin-body main
.admin-page-title → .admin-body main > h1
.admin-table → .admin-body table
.admin-fieldset → .admin-body fieldset
.admin-fieldset-legend → .admin-body legend
Also migrate the .admin-main > section / h2 / dl / dt / dd block to
.admin-body main > section so the thanks-page section styles survive.
Add .admin-body main > table { margin-top: 1.5rem } to absorb the inline
style="margin-top:1.5rem" that was on tags.php's <table class="admin-table">.
All 10 affected admin templates updated (add, edit, account, index, import,
pages, pages-edit, tags, system, thanks) — class attributes removed where
the element alone is now the selector. Zero visual changes.
57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
require_once __DIR__ . "/../../config/bootstrap.php";
|
|
require_once __DIR__ . '/../../src/AdminAuth.php';
|
|
AdminAuth::requireLogin();
|
|
|
|
require_once __DIR__ . '/../../src/Database.php';
|
|
|
|
$pageTitle = "Pages statiques";
|
|
|
|
try {
|
|
$db = new Database();
|
|
$pages = $db->getAllPages();
|
|
} catch (Exception $e) {
|
|
error_log("Error loading pages: " . $e->getMessage());
|
|
die("Erreur lors du chargement des pages.");
|
|
}
|
|
|
|
$success = $_SESSION['success'] ?? null;
|
|
unset($_SESSION['success']);
|
|
?>
|
|
<?php $isAdmin = true; $bodyClass = 'admin-body'; require_once APP_ROOT . '/templates/head.php'; ?>
|
|
<?php include APP_ROOT . '/templates/header.php'; ?>
|
|
|
|
<main id="main-content">
|
|
<h1>Pages statiques</h1>
|
|
|
|
<?php if ($success): ?>
|
|
<div class="admin-alert admin-alert--success">✓ <?= htmlspecialchars($success) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Slug</th>
|
|
<th scope="col">Titre</th>
|
|
<th scope="col">Mis à jour</th>
|
|
<th scope="col">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($pages as $p): ?>
|
|
<tr>
|
|
<td><code><?= htmlspecialchars($p['slug']) ?></code></td>
|
|
<td><?= htmlspecialchars($p['title']) ?></td>
|
|
<td><?= htmlspecialchars($p['updated_at'] ?? '—') ?></td>
|
|
<td>
|
|
<a href="/admin/pages-edit.php?slug=<?= urlencode($p['slug']) ?>"
|
|
class="admin-btn" style="font-size:.8rem;padding:.3rem .75rem;">Éditer</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</main>
|
|
|
|
<?php require_once APP_ROOT . '/templates/admin/footer.php'; ?>
|