diff --git a/gameserver/templatetags/search.py b/gameserver/templatetags/search.py index 3fc6cb1..4a87fa2 100644 --- a/gameserver/templatetags/search.py +++ b/gameserver/templatetags/search.py @@ -1,6 +1,7 @@ import re from django import template +from django.http import QueryDict from django.shortcuts import resolve_url register = template.Library() @@ -17,3 +18,12 @@ def get_search_page(request): elif match := re.fullmatch(r"^/contest/([^/]+)/scoreboard$", request.path): return resolve_url("contest_scoreboard", slug=match.group(1)) return + + +@register.filter +def format_GET(GET: QueryDict): + GET = GET.copy() + GET.pop("page", None) + if GET.get("nfts", None) == "": + del GET["nfts"] + return GET.urlencode() diff --git a/templates/paginator/snippet.html b/templates/paginator/snippet.html index f69d75b..264dd6c 100644 --- a/templates/paginator/snippet.html +++ b/templates/paginator/snippet.html @@ -1,15 +1,20 @@ +{% load search %} + + {% if page_obj.paginator %} {% endif %} + +