From c6199525f94ba09db58dfce3a5aa0df0d35ee20a Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Tue, 19 May 2026 21:00:40 +0200 Subject: [PATCH] =?UTF-8?q?add=20sticky=20thead=20to=20index,=20langues,?= =?UTF-8?q?=20and=20mots-cl=C3=A9s=20tables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 1 + app/public/admin/actions/language.php | 10 ++ app/public/admin/actions/tag.php | 11 ++ .../admin/contenus-langues-fragment.php | 10 +- .../admin/contenus-motscles-fragment.php | 12 +- app/public/assets/css/admin.css | 10 -- app/public/assets/css/components/tables.css | 14 +++ app/templates/admin/contenus.php | 104 +++++++++++++++++- app/templates/admin/index-table.php | 2 +- app/templates/admin/index.php | 2 +- 10 files changed, 155 insertions(+), 21 deletions(-) diff --git a/TODO.md b/TODO.md index 97b907a..0102870 100644 --- a/TODO.md +++ b/TODO.md @@ -104,6 +104,7 @@ # Current tasks +- [x] Sticky thead: fix with border-collapse:separate, CSS class, --sticky-top var, +min-height:50vh on wrappers, +bulk delete for mots-clés - [x] Edit submit redirects to recapitulatif instead of staying on edit.php - [x] Mandatory auto-generated passwords on share links (no custom passwords, regenerate-only in edit, rate limit on password gate) - [x] .gitignore / .ignore: exclude *.db-wal and *.db-shm diff --git a/app/public/admin/actions/language.php b/app/public/admin/actions/language.php index 0f4126d..0989d9c 100644 --- a/app/public/admin/actions/language.php +++ b/app/public/admin/actions/language.php @@ -54,6 +54,16 @@ try { $db->deleteLanguage($id); break; + case 'delete_bulk': + $sourceIds = isset($_POST['selected_langs']) && is_array($_POST['selected_langs']) + ? array_map('intval', $_POST['selected_langs']) + : []; + if (empty($sourceIds)) throw new Exception("Aucune langue sélectionnée."); + foreach ($sourceIds as $sid) { + $db->deleteLanguage($sid); + } + break; + default: throw new Exception("Action inconnue."); } diff --git a/app/public/admin/actions/tag.php b/app/public/admin/actions/tag.php index bb091e6..efe3a7d 100644 --- a/app/public/admin/actions/tag.php +++ b/app/public/admin/actions/tag.php @@ -58,6 +58,17 @@ try { $logger->logTagAction('delete', ['tag_id' => $id]); break; + case 'delete_bulk': + $sourceIds = isset($_POST['selected_tags']) && is_array($_POST['selected_tags']) + ? array_map('intval', $_POST['selected_tags']) + : []; + if (empty($sourceIds)) throw new Exception("Aucun mot-clé sélectionné."); + foreach ($sourceIds as $sid) { + $db->deleteTag($sid); + $logger->logTagAction('delete', ['tag_id' => $sid]); + } + break; + default: throw new Exception("Action inconnue."); } diff --git a/app/public/admin/contenus-langues-fragment.php b/app/public/admin/contenus-langues-fragment.php index becad46..bc3706c 100644 --- a/app/public/admin/contenus-langues-fragment.php +++ b/app/public/admin/contenus-langues-fragment.php @@ -24,13 +24,19 @@ try { die('
Erreur : ' . htmlspecialchars($e->getMessage()) . '
'); } ?> -