From b4d3c6256d4f8cb4b55afce4ab76de55259a7c42 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Sun, 18 Jun 2023 16:31:26 +0200 Subject: [PATCH] fix: [title] fix title search empty result --- var/www/blueprints/objects_title.py | 1 + .../templates/objects/title/search_title_result.html | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/var/www/blueprints/objects_title.py b/var/www/blueprints/objects_title.py index ab6ffd25..3cac6b31 100644 --- a/var/www/blueprints/objects_title.py +++ b/var/www/blueprints/objects_title.py @@ -126,6 +126,7 @@ def objects_title_search(): dict_objects = titles.get_metas(dict_page['list_elem'], options={'sparkline'}) else: dict_objects = {} + dict_page = {} return render_template("search_title_result.html", dict_objects=dict_objects, search_result=search_result, dict_page=dict_page, diff --git a/var/www/templates/objects/title/search_title_result.html b/var/www/templates/objects/title/search_title_result.html index 34a4524a..d62f9daf 100644 --- a/var/www/templates/objects/title/search_title_result.html +++ b/var/www/templates/objects/title/search_title_result.html @@ -71,10 +71,12 @@ - {% with page=dict_page['page'], nb_page_max=dict_page['nb_pages'], nb_first_elem=dict_page['nb_first_elem'], nb_last_elem=dict_page['nb_last_elem'], nb_all_elem=dict_page['nb_all_elem'] %} - {% set target_url=url_for('objects_title.objects_title_search') + "?search=" + to_search + "&search_type=" + type_to_search + "&case_sensitive=" + case_sensitive|string %} - {% include 'pagination.html' %} - {% endwith %} + {% if dict_page %} + {% with page=dict_page['page'], nb_page_max=dict_page['nb_pages'], nb_first_elem=dict_page['nb_first_elem'], nb_last_elem=dict_page['nb_last_elem'], nb_all_elem=dict_page['nb_all_elem'] %} + {% set target_url=url_for('objects_title.objects_title_search') + "?search=" + to_search + "&search_type=" + type_to_search + "&case_sensitive=" + case_sensitive|string %} + {% include 'pagination.html' %} + {% endwith %} + {% endif %}