From 2d6e5fbdc45a63d48680989db34ac50041d21f95 Mon Sep 17 00:00:00 2001 From: Paul van Genuchten Date: Mon, 20 May 2024 11:41:06 +0200 Subject: [PATCH] reset pagination at filter change --- pycsw/ogc/api/templates/items.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pycsw/ogc/api/templates/items.html b/pycsw/ogc/api/templates/items.html index 297d6b6ba..a28393675 100644 --- a/pycsw/ogc/api/templates/items.html +++ b/pycsw/ogc/api/templates/items.html @@ -50,11 +50,14 @@ {% endif %} {# update existing url with new key,val. indent prevents spaces in output #} +{# reset pagination, else you may end up in empty result #} {% macro updateurl(key=None,val=None) %}{{ nav_links.self.split('?')[0] }}?{% - for at in attrs.keys() %}{% - if attrs[at] not in [None,''] %}{% - if key not in [None,''] and key == at %}&{{ at }}={{ val }}{% - else %}&{{ at }}={{ attrs[at] }}{% + for at in attrs.keys() %}{% + if at != 'offset' %}{% + if attrs[at] not in [None,''] %}{% + if key not in [None,''] and key == at %}&{{ at }}={{ val }}{% + else %}&{{ at }}={{ attrs[at] }}{% + endif %}{% endif %}{% endif %}{% if key not in attrs.keys() %}&{{ key }}={{ val }}{% endif %}{% @@ -100,7 +103,7 @@
{% if 'facets=true' in nav_links.self %} - Reset + Reset {% endif %}