From 07370b722176ebe513ec2f32b39920b0d180cdcd Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Tue, 9 Jun 2026 13:20:26 +0200 Subject: [PATCH] =?UTF-8?q?search:=20ajout=20filtres=20finalit=C3=A9=20et?= =?UTF-8?q?=20format,=20boutons=20plus=20compacts=20et=20R=C3=A9initialise?= =?UTF-8?q?r=20en=20neutre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TODO.md | 2 ++ app/public/assets/css/repertoire.css | 18 +++------------ app/src/Controllers/SearchController.php | 12 ++++++++++ app/templates/public/search.php | 28 ++++++++++++++++++++++-- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/TODO.md b/TODO.md index f5d493f..56b9719 100644 --- a/TODO.md +++ b/TODO.md @@ -10,4 +10,6 @@ - [x] Fix #7: Options de licence non persistées en edit — HTMX load trigger perdait les valeurs - [x] Fix #3 (v2): findOrCreateAuthor avec cascade ID → nom → email, setThesisAuthors passe les IDs existants - [x] Migration 038: corriger les identifiers theses qui ne matchent pas leur année +- [x] Filtres finalité + format dans la page de recherche (search.php) +- [x] Styliser boutons Filtrer/Réinitialiser : plus compacts, Réinitialiser en neutre - [ ] Commit + jj new diff --git a/app/public/assets/css/repertoire.css b/app/public/assets/css/repertoire.css index e5d70ed..e16e32f 100644 --- a/app/public/assets/css/repertoire.css +++ b/app/public/assets/css/repertoire.css @@ -250,7 +250,7 @@ display: flex; align-items: center; gap: var(--space-s); - padding: var(--space-3xs) var(--space-m); + padding: var(--space-xs) var(--space-m); border-bottom: 1px solid var(--border-secondary); flex-shrink: 0; flex-wrap: wrap; @@ -278,21 +278,9 @@ border: 2px solid var(--accent-primary); } -.search-apply-btn { - /* deprecated alias for .btn--primary; kept for backward-compat */ -} - +.search-apply-btn, .search-reset-link { - font-size: var(--step--1); - color: var(--text-secondary); - text-decoration: none; - font-weight: 400; - cursor: pointer; - transition: color 0.15s; -} - -.search-reset-link:hover { - color: var(--accent-primary); + /* btn--sm classes handle styling; space kept for potential overrides */ } /* Search results pagination */ diff --git a/app/src/Controllers/SearchController.php b/app/src/Controllers/SearchController.php index 8f957cc..084193d 100644 --- a/app/src/Controllers/SearchController.php +++ b/app/src/Controllers/SearchController.php @@ -87,6 +87,8 @@ class SearchController $years = []; $orientations = []; $apPrograms = []; + $finalityTypes = []; + $formatTypes = []; $coverMap = []; try { @@ -100,6 +102,8 @@ class SearchController $years = $this->db->getAvailableYears(); $orientations = $this->db->getAllOrientations(); $apPrograms = $this->db->getAllAPPrograms(); + $finalityTypes = $this->db->getAllFinalityTypes(); + $formatTypes = $this->db->getAllFormatTypes(); if (!empty($results)) { $coverMap = $this->db->getCoverPathsForTheses(array_column($results, 'id')); } @@ -129,6 +133,8 @@ class SearchController 'years' => $years, 'orientations' => $orientations, 'apPrograms' => $apPrograms, + 'finalityTypes' => $finalityTypes, + 'formatTypes' => $formatTypes, // Page meta 'searchBarValue' => $query, @@ -311,6 +317,12 @@ class SearchController if (!empty($_GET['ap_program'])) { $params['ap_program'] = (string) $_GET['ap_program']; } + if (!empty($_GET['finality'])) { + $params['finality'] = (string) $_GET['finality']; + } + if (!empty($_GET['format'])) { + $params['format'] = (string) $_GET['format']; + } if (!empty($_GET['keyword'])) { $params['keyword'] = (string) $_GET['keyword']; } diff --git a/app/templates/public/search.php b/app/templates/public/search.php index 06c52ad..610ee3d 100644 --- a/app/templates/public/search.php +++ b/app/templates/public/search.php @@ -41,8 +41,32 @@ - - Réinitialiser + + + + + + Réinitialiser