Move Formulaire settings to contenus, remove delete-all TFE

- Removed 'Supprimer tous les TFE' danger zone from parametres (template, dialog,
  backend handler, Database::deleteAllTheses(), AdminLogger method)
- Moved Formulaire section (access type toggles, restricted files) from parametres
  to contenus under new h2 'Paramètres du Formulaire'
- Moved Types de travaux from parametres to contenus as sub-section under
  Paramètres du Formulaire
- Existing 'Structure du formulaire' section now a sub-heading (h3) under
  Paramètres du Formulaire in contenus
- Sub-sections: Restrictions d'accès aux fichiers, Degré d'ouverture,
  Types de travaux, Structure du Formulaire
- Added siteSettings query to contenus controller
This commit is contained in:
Pontoporeia
2026-05-10 11:39:25 +02:00
parent 048a14bc2e
commit 494675d78c
4 changed files with 158 additions and 120 deletions

View File

@@ -605,15 +605,36 @@ th.admin-ap-col {
font-size: var(--step--1); font-size: var(--step--1);
} }
/* ── Paramètres page top-level sections (flat, no border card) ──────────── */ /* ── Flat sections (no border card) — parametres + contenus ─────────────── */
.admin-body main > section[aria-labelledby^="settings-"] { .admin-body main > section[aria-labelledby^="settings-"],
.admin-body main > section[aria-labelledby^="static-pages-"],
.admin-body main > section[aria-labelledby^="form-settings-"] {
border: none; border: none;
border-radius: 0; border-radius: 0;
padding: 0; padding: 0;
margin-bottom: var(--space-xl); margin-bottom: var(--space-xl);
} }
.admin-body main > section[aria-labelledby^="settings-"] > h2 { /* Fieldsets inside flat sections: no card border */
.admin-body main > section[aria-labelledby^="settings-"] fieldset,
.admin-body main > section[aria-labelledby^="form-settings-"] fieldset {
border: none;
border-radius: 0;
padding: var(--space-m) 0;
}
.admin-body main > section[aria-labelledby^="settings-"] fieldset legend,
.admin-body main > section[aria-labelledby^="form-settings-"] fieldset legend {
padding: 0;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--text-secondary);
}
.admin-body main > section[aria-labelledby^="settings-"] > h2,
.admin-body main > section[aria-labelledby^="static-pages-"] > h2,
.admin-body main > section[aria-labelledby^="form-settings-"] > h2 {
font-weight: 600; font-weight: 600;
letter-spacing: 0.06em; letter-spacing: 0.06em;
text-transform: uppercase; text-transform: uppercase;

View File

@@ -113,6 +113,19 @@
+%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision) +%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
+\\\\\\\ to: qxuprqpt a1b3064d "Add language-search component for Autre Langue input + active search in lists" (rebased revision) +\\\\\\\ to: qxuprqpt a1b3064d "Add language-search component for Autre Langue input + active search in lists" (rebased revision)
++ $linkName = $link['name'] ?? ''; ++ $linkName = $link['name'] ?? '';
++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: qxuprqpt a1b3064d "Add language-search component for Autre Langue input + active search in lists" (rebased revision)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
- $linkName = $link['name'] ?? '';
- $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: somsyvxz 14a3cd10 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebase destination)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: sntroxlt a8d07458 "Move Formulaire settings to contenus, remove delete-all TFE" (rebased revision)
$linkName = $link['name'] ?? '';
$linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
$linkLockedYear = $link['locked_year'] ?? null;
+%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision)
+\\\\\\\ to: sntroxlt 6a5b93f3 "Move Formulaire settings to contenus, remove delete-all TFE" (rebased revision)
++ $linkName = $link['name'] ?? '';
++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : ''; ++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : '';
?> ?>
<tr class="admin-table-row" onclick="event.stopPropagation(); window.open('/partage/<?= urlencode($link['slug']) ?>', '_blank')" style="cursor:pointer"> <tr class="admin-table-row" onclick="event.stopPropagation(); window.open('/partage/<?= urlencode($link['slug']) ?>', '_blank')" style="cursor:pointer">

View File

@@ -11,14 +11,48 @@
<div class="flash-error" role="alert"><?= htmlspecialchars($flash['error']) ?></div> <div class="flash-error" role="alert"><?= htmlspecialchars($flash['error']) ?></div>
<?php endif; ?> <?php endif; ?>
<!-- ═══════════════════════════════════════════════════════════════════
PAGES STATIQUES
═══════════════════════════════════════════════════════════════════ -->
<section aria-labelledby="static-pages-title">
<h2 id="static-pages-title">Pages statiques</h2>
<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/contenus-edit.php?slug=<?= urlencode($p['slug']) ?>"
class="admin-icon-btn admin-icon-btn--edit" title="Éditer">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256"><path d="M248,92.68a15.86,15.86,0,0,0-4.69-11.31L174.63,12.68a16,16,0,0,0-22.63,0L123.57,41.11l-58,21.77A16.06,16.06,0,0,0,55.35,75.23L32.11,214.68A8,8,0,0,0,40,224a8.4,8.4,0,0,0,1.32-.11l139.44-23.24a16,16,0,0,0,12.35-10.17l21.77-58L243.31,104A15.87,15.87,0,0,0,248,92.68Zm-69.87,92.19L63.32,204l47.37-47.37a28,28,0,1,0-11.32-11.32L52,192.7,71.13,77.86,126,57.29,198.7,130ZM112,132a12,12,0,1,1,12,12A12,12,0,0,1,112,132Zm96-15.32L139.31,48l24-24L232,92.68Z"></path></svg>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</section>
<!-- ═══════════════════════════════════════════════════════════════════ <!-- ═══════════════════════════════════════════════════════════════════
PARAMÈTRES DU FORMULAIRE PARAMÈTRES DU FORMULAIRE
═══════════════════════════════════════════════════════════════════ --> ═══════════════════════════════════════════════════════════════════ -->
<section aria-labelledby="form-settings-title">
<h2 id="form-settings-title">Paramètres du Formulaire</h2> <h2 id="form-settings-title">Paramètres du Formulaire</h2>
<!-- ── Restrictions d'accès aux fichiers ── --> <!-- ── Restrictions d'accès aux fichiers ── -->
<section aria-labelledby="form-restricted-files-title"> <fieldset>
<h3 id="form-restricted-files-title">Restrictions d'accès aux fichiers</h3> <legend>Restrictions d'accès aux fichiers</legend>
<form method="post" action="actions/settings.php" class="param-form"> <form method="post" action="actions/settings.php" class="param-form">
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>"> <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
@@ -35,11 +69,11 @@
<button type="submit" class="btn btn--primary">Enregistrer</button> <button type="submit" class="btn btn--primary">Enregistrer</button>
</form> </form>
</section> </fieldset>
<!-- ── Degré d'ouverture ── --> <!-- ── Degré d'ouverture ── -->
<section aria-labelledby="form-access-types-title"> <fieldset>
<h3 id="form-access-types-title">Degré d'ouverture</h3> <legend>Degré d'ouverture</legend>
<p>Options de visibilité disponibles dans le formulaire d'ajout de TFE.</p> <p>Options de visibilité disponibles dans le formulaire d'ajout de TFE.</p>
<p class="param-note">L'option <strong>Libre</strong> ne sera activée qu'à partir de l'année académique prochaine.</p> <p class="param-note">L'option <strong>Libre</strong> ne sera activée qu'à partir de l'année académique prochaine.</p>
@@ -76,11 +110,11 @@
<button type="submit" class="btn btn--primary">Enregistrer</button> <button type="submit" class="btn btn--primary">Enregistrer</button>
</form> </form>
</section> </fieldset>
<!-- ── Types de travaux ── --> <!-- ── Types de travaux ── -->
<section aria-labelledby="form-objet-types-title"> <fieldset>
<h3 id="form-objet-types-title">Types de travaux</h3> <legend>Types de travaux</legend>
<p>Active ou désactive les types de travaux dans les formulaires et la consultation. Un type désactivé ne peut plus être soumis ni affiché sur le site.</p> <p>Active ou désactive les types de travaux dans les formulaires et la consultation. Un type désactivé ne peut plus être soumis ni affiché sur le site.</p>
<p class="param-note">Le type <strong>TFE</strong> est toujours actif et ne peut pas être désactivé.</p> <p class="param-note">Le type <strong>TFE</strong> est toujours actif et ne peut pas être désactivé.</p>
@@ -116,42 +150,11 @@
<button type="submit" class="btn btn--primary">Enregistrer</button> <button type="submit" class="btn btn--primary">Enregistrer</button>
</form> </form>
</section> </fieldset>
<!-- ═══════════════════════════════════════════════════════════════════
PAGES STATIQUES
═══════════════════════════════════════════════════════════════════ -->
<h2>Pages statiques</h2>
<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/contenus-edit.php?slug=<?= urlencode($p['slug']) ?>"
class="admin-icon-btn admin-icon-btn--edit" title="Éditer">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256"><path d="M248,92.68a15.86,15.86,0,0,0-4.69-11.31L174.63,12.68a16,16,0,0,0-22.63,0L123.57,41.11l-58,21.77A16.06,16.06,0,0,0,55.35,75.23L32.11,214.68A8,8,0,0,0,40,224a8.4,8.4,0,0,0,1.32-.11l139.44-23.24a16,16,0,0,0,12.35-10.17l21.77-58L243.31,104A15.87,15.87,0,0,0,248,92.68Zm-69.87,92.19L63.32,204l47.37-47.37a28,28,0,1,0-11.32-11.32L52,192.7,71.13,77.86,126,57.29,198.7,130ZM112,132a12,12,0,1,1,12,12A12,12,0,0,1,112,132Zm96-15.32L139.31,48l24-24L232,92.68Z"></path></svg>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- ── Structure du formulaire ── --> <!-- ── Structure du formulaire ── -->
<section aria-labelledby="form-help-blocks"> <fieldset>
<h3 id="form-help-blocks">Structure du Formulaire</h3> <legend>Structure du Formulaire</legend>
<p class="fhb-hint"> <p class="fhb-hint">
Chaque <strong>bloc d'aide</strong> s'affiche au-dessus de sa section dans le formulaire de soumission. Chaque <strong>bloc d'aide</strong> s'affiche au-dessus de sa section dans le formulaire de soumission.
Le <strong>bouton rond</strong> active/désactive l'affichage. Le <strong>bouton rond</strong> active/désactive l'affichage.
@@ -232,6 +235,7 @@
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</fieldset>
</section> </section>
</main> </main>

View File

@@ -16,7 +16,7 @@
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>"> <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<input type="hidden" name="action" value="disable_maintenance"> <input type="hidden" name="action" value="disable_maintenance">
<input type="hidden" name="redirect" value="/admin/parametres.php"> <input type="hidden" name="redirect" value="/admin/parametres.php">
<button type="submit">Désactiver la maintenance</button> <button type="submit" class="btn btn--secondary">Désactiver la maintenance</button>
</form> </form>
<?php else: ?> <?php else: ?>
<p>Site public : <strong>en ligne</strong></p> <p>Site public : <strong>en ligne</strong></p>