Self hosted FLOSS fitness/workout, nutrition and weight tracker
Simplify querystring creation on the exercise admin template
Roland Geider08277ea89a67
diff --git a/wger/exercises/templates/history/overview.html b/wger/exercises/templates/history/overview.htmlindex a87c78e27..93e45dabe 100644--- a/wger/exercises/templates/history/overview.html+++ b/wger/exercises/templates/history/overview.html@@ -247,12 +247,12 @@<ul class="pagination justify-content-center">{% if page_obj.has_previous %}<li class="page-item">- <a class="page-link" href="?page=1{% if querystring %}&{{ querystring }}{% endif %}">+ <a class="page-link" href="{% querystring page=1 %}">« {% translate "First" %}</a></li><li class="page-item">- <a class="page-link" href="?page={{ page_obj.previous_page_number }}{% if querystring %}&{{ querystring }}{% endif %}">+ <a class="page-link" href="{% querystring page=page_obj.previous_page_number %}">‹ {% translate "Previous" %}</a></li>@@ -269,12 +269,12 @@{% if page_obj.has_next %}<li class="page-item">- <a class="page-link" href="?page={{ page_obj.next_page_number }}{% if querystring %}&{{ querystring }}{% endif %}">+ <a class="page-link" href="{% querystring page=page_obj.next_page_number %}">{% translate "Next" %} ›</a></li><li class="page-item">- <a class="page-link" href="?page={{ paginator.num_pages }}{% if querystring %}&{{ querystring }}{% endif %}">+ <a class="page-link" href="{% querystring page=paginator.num_pages %}">{% translate "Last" %} »</a></li>diff --git a/wger/exercises/views/history.py b/wger/exercises/views/history.pyindex ac39051ee..ef82cf895 100644--- a/wger/exercises/views/history.py+++ b/wger/exercises/views/history.py@@ -279,11 +279,6 @@ def control(request: HttpRequest) -> HttpResponse:out.append(data)- # GET parameters without ``page`` so pagination links keep filters intact.- qs_no_page = request.GET.copy()- qs_no_page.pop('page', None)- querystring = qs_no_page.urlencode()-return render(request,'history/overview.html',@@ -293,7 +288,6 @@ def control(request: HttpRequest) -> HttpResponse:'page_obj': page,'paginator': paginator,'is_paginated': page.has_other_pages(),- 'querystring': querystring,'stats': stats,# We can't pass the enum to the template, so we have to do this# https://stackoverflow.com/questions/35953132/