mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
83 lines
4.5 KiB
PHP
83 lines
4.5 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"><img src="/assets/icons/arrow-left-circle.svg" width="32" height="32" alt="" aria-hidden="true"></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">
|
|
<img src="/assets/icons/archive-box.svg" width="32" height="32" alt="" aria-hidden="true">
|
|
</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">
|
|
<img src="/assets/icons/trash.svg" width="32" height="32" alt="" aria-hidden="true">
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php endif; ?>
|
|
</main>
|