mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Replace every <img src="/assets/icons/..."> with <?= icon('name') ?>
across 26 template files. The PHP helper inlines the SVG markup into the
DOM so CSS color cascades naturally through fill="currentColor".
- Add src/icon.php helper: reads SVG file, sets width/height to 1em,
injects aria-hidden, supports optional CSS class
- Fix 12 icon SVGs that had hardcoded fill="#000000" or missing fill attr
- Replace search.svg with Phosphor fill-based magnifying glass
- Add explicit SVG sizes for admin header nav icons (16px/20px)
- Scope public search icon CSS to form[role=search]:not(.header-search-form)
to avoid breaking admin header layout; change stroke to fill
- Remove <img> filter: brightness(0) invert(1) hacks from admin.css
83 lines
4.3 KiB
PHP
83 lines
4.3 KiB
PHP
<main id="main-content" class="admin-main--list">
|
|
<div class="admin-list-toolbar admin-list-toolbar--list">
|
|
<div class="admin-toolbar-top">
|
|
<div class="admin-toolbar-title-row">
|
|
<h1><a href="/admin/" class="admin-back-btn" title="Retour à la liste"><?= icon('arrow-left-circle') ?></a> Corbeille</h1>
|
|
<span class="admin-stat admin-stat--inline" style="margin-left:auto"><?= count($trashedTheses) ?> TFE(s)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
$flash = App::consumeFlash();
|
|
?>
|
|
<?php if ($flash['success']): ?>
|
|
<div class="flash-success" role="alert"><?= htmlspecialchars($flash['success']) ?></div>
|
|
<?php endif; ?>
|
|
<?php if ($flash['error']): ?>
|
|
<div class="flash-error" role="alert"><?= htmlspecialchars($flash['error']) ?></div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (empty($trashedTheses)): ?>
|
|
<div class="admin-empty">La corbeille est vide.</div>
|
|
<?php else: ?>
|
|
<form method="post" action="actions/corbeille.php" style="margin-bottom:var(--space-xs)">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
|
<input type="hidden" name="action" value="empty_trash">
|
|
<button type="submit" class="btn btn--danger btn--sm" onclick="return confirm('Vider toute la corbeille ? Cette action est irréversible.')">
|
|
Vider la corbeille
|
|
</button>
|
|
</form>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">ID</th>
|
|
<th scope="col">Titre</th>
|
|
<th scope="col">Auteur(s)</th>
|
|
<th scope="col">Année</th>
|
|
<th scope="col">Supprimé le</th>
|
|
<th scope="col" style="width:1%">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($trashedTheses as $t): ?>
|
|
<tr>
|
|
<td><?= htmlspecialchars($t['identifier'] ?? '#' . $t['id']) ?></td>
|
|
<td>
|
|
<strong><?= htmlspecialchars($t['title']) ?></strong>
|
|
<?php if (!empty($t['subtitle'])): ?>
|
|
<br><small><?= htmlspecialchars($t['subtitle']) ?></small>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?= htmlspecialchars($t['authors'] ?? '—') ?></td>
|
|
<td><?= (int)$t['year'] ?></td>
|
|
<td><?= htmlspecialchars($t['deleted_at']) ?></td>
|
|
<td class="admin-actions-col">
|
|
<div class="admin-actions">
|
|
<form method="post" action="actions/corbeille.php" class="admin-inline-form" style="display:inline">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
|
<input type="hidden" name="action" value="restore">
|
|
<input type="hidden" name="thesis_id" value="<?= (int)$t['id'] ?>">
|
|
<button type="submit" class="admin-icon-btn admin-icon-btn--edit" title="Restaurer">
|
|
<?= icon('archive-box') ?>
|
|
</button>
|
|
</form>
|
|
<form method="post" action="actions/corbeille.php" class="admin-inline-form" style="display:inline"
|
|
onsubmit="return confirm('Supprimer définitivement ce TFE ? Cette action est irréversible.')">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
|
<input type="hidden" name="action" value="hard_delete">
|
|
<input type="hidden" name="thesis_id" value="<?= (int)$t['id'] ?>">
|
|
<button type="submit" class="admin-icon-btn admin-icon-btn--delete" title="Supprimer définitivement">
|
|
<?= icon('trash') ?>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
</main>
|