Skip to content

Commit

Permalink
reset pagination at filter change
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed May 20, 2024
1 parent 219a3b0 commit 2d6e5fb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pycsw/ogc/api/templates/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}{%
Expand Down Expand Up @@ -100,7 +103,7 @@
</div>
<div>
{% if 'facets=true' in nav_links.self %}
<a href="#" onclick="{{ reseturl() }}">Reset</a>
<a href="{{ reseturl() }}">Reset</a>
{% endif %}
</div>
</div>
Expand Down

0 comments on commit 2d6e5fb

Please sign in to comment.