mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
101 lines
5.3 KiB
PHP
101 lines
5.3 KiB
PHP
<script src="<?= App::assetV('/assets/js/app/admin-index-bulk.js') ?>"></script>
|
|
|
|
<main id="main-content" class="admin-main--list">
|
|
<!-- Title + filters + stats + import all in one toolbar row -->
|
|
<div class="admin-list-toolbar admin-list-toolbar--list">
|
|
<div class="admin-toolbar-top">
|
|
<div class="admin-toolbar-title-row">
|
|
<h1>Liste des TFE</h1>
|
|
<div class="admin-stats">
|
|
<fieldset class="admin-stat">
|
|
<legend class="admin-stat__label">Total</legend>
|
|
<span class="admin-stat__number"><?= $stats['total'] ?></span>
|
|
</fieldset>
|
|
<fieldset class="admin-stat admin-stat--pub">
|
|
<legend class="admin-stat__label">Publiés</legend>
|
|
<span class="admin-stat__number"><?= $stats['published'] ?></span>
|
|
</fieldset>
|
|
<fieldset class="admin-stat admin-stat--pend">
|
|
<legend class="admin-stat__label">Attente</legend>
|
|
<span class="admin-stat__number"><?= $stats['pending'] ?></span>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="admin-btn-group">
|
|
<a href="/admin/add.php" class="btn btn--primary btn--sm"><?= icon('plus-circle') ?> Ajouter un TFE</a>
|
|
<?php if ($trashCount > 0): ?>
|
|
<a href="/admin/index.php?tab=trash" class="btn btn--sm <?= $tab === 'trash' ? 'btn--primary' : 'btn--secondary' ?>">
|
|
Corbeille (<?= $trashCount ?>)
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php if ($tmpTotalCount > 0): ?>
|
|
<button type="button" class="btn btn--sm btn--secondary" id="tmp-cleanup-btn"
|
|
onclick="document.getElementById('tmp-cleanup-dialog').showModal(); htmx.trigger('#tmp-cleanup-stats-wrapper','loadStats'); htmx.trigger('#peertube-orphans-fragment','loadPeertube')">
|
|
<?= icon('trash') ?> Nettoyer (<?= $tmpTotalCount ?>)
|
|
</button>
|
|
<?php endif; ?>
|
|
<button type="button" class="btn btn--primary btn--sm" id="import-dialog-btn"
|
|
onclick="document.getElementById('import-dialog').showModal(); window.XamxamInitFilePonds()">
|
|
<?= icon('tray-arrow-up') ?> Importer
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="admin-filter-form" class="admin-filters" method="get" action="/admin/"
|
|
hx-get="/admin/"
|
|
hx-trigger="change from:select, input changed delay:300ms from:input[name=search], keyup[key=='Enter'] from:input[name=search]"
|
|
hx-target="#admin-table-wrap"
|
|
hx-swap="innerHTML"
|
|
hx-indicator="#admin-search-indicator"
|
|
hx-include="#admin-filter-form, #admin-table-wrap input[name=sort], #admin-table-wrap input[name=dir]"
|
|
hx-push-url="true"
|
|
hx-sync="#admin-filter-form:replace">
|
|
<input type="text" name="search" placeholder="Titre, auteur..."
|
|
value="<?= htmlspecialchars($searchQuery) ?>">
|
|
<select name="year">
|
|
<option value="">Année</option>
|
|
<?php foreach ($years as $y): ?>
|
|
<option value="<?= $y ?>" <?= $yearFilter == $y ? 'selected' : '' ?>><?= $y ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="ap">
|
|
<option value="">AP</option>
|
|
<?php foreach ($apPrograms as $ap): ?>
|
|
<option value="<?= $ap['id'] ?>" <?= $apFilter == $ap['id'] ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($ap['code'] ?? $ap['name']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<select name="orientation">
|
|
<option value="">Orientation</option>
|
|
<?php foreach ($orientations as $o): ?>
|
|
<option value="<?= $o['id'] ?>" <?= $orientationFilter == $o['id'] ? 'selected' : '' ?>>
|
|
<?= htmlspecialchars($o['name']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
<?php if ($searchQuery || $yearFilter || $orientationFilter || $apFilter): ?>
|
|
<a href="/admin/" class="btn btn--secondary btn--sm admin-filters-reset">✕ Réinitialiser</a>
|
|
<?php endif; ?>
|
|
</form>
|
|
|
|
<!-- Loading indicator bar -->
|
|
<div id="admin-search-indicator" class="admin-search-indicator"></div>
|
|
</div>
|
|
|
|
<?php include APP_ROOT . '/templates/admin/index-table.php'; ?>
|
|
</main>
|
|
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/no-selection.php'; ?>
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/bulk-confirm.php'; ?>
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/bulk-delete.php'; ?>
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/delete-thesis.php'; ?>
|
|
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/import.php'; ?>
|
|
|
|
<?php include APP_ROOT . '/templates/admin/partials/dialogs/tmp-cleanup.php'; ?>
|
|
|
|
<?php if ($importMessage || !empty($importErrors)): ?>
|
|
<script>document.getElementById('import-dialog').showModal();</script>
|
|
<?php endif; ?>
|