From aa13a2389a662eaab434867ef721521de30fdbcf Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 2 May 2024 15:42:53 +0200 Subject: [PATCH] store: simplify query args handling because 'request' is available in jinja templates (#2286) --- store/app.py | 3 --- store/templates/catalog.html | 12 ++++++------ store/templates/wishlist.html | 6 +++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/store/app.py b/store/app.py index 6bd53052..50c2f5a4 100644 --- a/store/app.py +++ b/store/app.py @@ -186,9 +186,6 @@ def star_app(app_id, action): def browse_wishlist(): return render_template( "wishlist.html", - init_sort=request.args.get("sort"), - init_search=request.args.get("search"), - init_starsonly=request.args.get("starsonly"), wishlist=get_wishlist(), stars=get_stars(), ) diff --git a/store/templates/catalog.html b/store/templates/catalog.html index d07fd883..3c357a62 100644 --- a/store/templates/catalog.html +++ b/store/templates/catalog.html @@ -89,7 +89,7 @@ type="text" id="search" placeholder="{{ _('Search for…') }}" - {% if init_search %}value="{{ init_search }}"{% endif %} + {% if request.args.get("search") %}value="{{ request.args.get("search") }}"{% endif %} class="w-full rounded-md border-gray-200 shadow-sm sm:text-sm py-2 pe-10" > @@ -106,7 +106,7 @@ > {% for id, category in catalog['categories'].items() %} - + {% endfor %} @@ -120,15 +120,15 @@ id="selectsort" class="inline-block rounded-md border-gray-200 text-sm ml-1 pl-1 pr-7 h-8 py-0" > - - - + + +