From a2243e5e9a8bf9f55fe53c997937f94778b940d4 Mon Sep 17 00:00:00 2001 From: Sli Date: Wed, 17 Dec 2025 00:05:18 +0100 Subject: [PATCH] Fix pagination on matmat, don't allow empty matmat search and add htmx pagination --- core/templates/core/macros.jinja | 6 ++++-- locale/fr/LC_MESSAGES/django.po | 6 +++++- matmat/forms.py | 8 +++++++- matmat/templates/matmat/search_form.jinja | 13 ++++++++---- matmat/tests.py | 24 +++++++++++++++++++++++ matmat/views.py | 5 +++-- 6 files changed, 52 insertions(+), 10 deletions(-) diff --git a/core/templates/core/macros.jinja b/core/templates/core/macros.jinja index d78725b7..e2f19314 100644 --- a/core/templates/core/macros.jinja +++ b/core/templates/core/macros.jinja @@ -161,6 +161,7 @@ hx-swap="innerHTML" hx-target="#content" hx-push-url="true" + hx-trigger="click, keyup[key=='ArrowLeft'] from:body" {%- else -%} href="?{{ querystring(page=current_page.previous_page_number()) }}" {%- endif -%} @@ -195,12 +196,13 @@ {% if current_page.has_next() %}