Eradicate the dedupe_qs filter

The new `extend_query` and `urlencode` filters are way cleaner ways
to achieve what we did with `dedupe_qs`.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-08-31 14:27:16 -07:00
parent c9374732c0
commit 210e459ba9
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
5 changed files with 11 additions and 53 deletions

View file

@ -24,7 +24,7 @@
<th>
{% set off_qs = "%s=%d" | format(off_param, off) %}
{% set by_qs = "%s=%s" | format(by_param, by_next | quote_plus) %}
<a href="?{{ q | dedupe_qs(off_qs, by_qs) }}">
<a href="?{{ q | extend_query([off_param, off], [by_param, by_next]) | urlencode }}">
{{ "Start" | tr }}
</a>
</th>
@ -97,7 +97,7 @@
{% set off_qs = "%s=%d" | format(off_param, off - 10) %}
{% set by_qs = "%s=%s" | format(by_param, by | quote_plus) %}
<a class="page"
href="?{{ q | dedupe_qs(off_qs, by_qs) }}">
href="?{{ q | extend_query([off_param, ([off - 10, 0] | max)], [by_param, by]) | urlencode }}">
Back
</a>
{% endif %}
@ -106,7 +106,7 @@
{% set off_qs = "%s=%d" | format(off_param, off + 10) %}
{% set by_qs = "%s=%s" | format(by_param, by | quote_plus) %}
<a class="page"
href="?{{ q | dedupe_qs(off_qs, by_qs) }}">
href="?{{ q | extend_query([off_param, off + pp], [by_param, by]) | urlencode }}">
Next
</a>
{% endif %}