From ed38ce1136be85d2228b724e689d5b2915f1a632 Mon Sep 17 00:00:00 2001 From: Greg Barnes Date: Wed, 16 Oct 2024 18:01:56 +0100 Subject: [PATCH] Adds no results found content, adds page no. to title, shows docs shown in results header --- orp/orp_search/public_gateway.py | 2 + orp/orp_search/templates/orp.html | 81 +++++++++++++++++++++---------- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/orp/orp_search/public_gateway.py b/orp/orp_search/public_gateway.py index 9128804..f280a95 100644 --- a/orp/orp_search/public_gateway.py +++ b/orp/orp_search/public_gateway.py @@ -91,6 +91,8 @@ def finalise_results( context["results_total_count"] = paginator.count context["results_page_total"] = paginator.num_pages context["current_page"] = config.offset + context["start_index"] = paginated_documents.start_index() + context["end_index"] = paginated_documents.end_index() return context def search(self, config: SearchDocumentConfig): diff --git a/orp/orp_search/templates/orp.html b/orp/orp_search/templates/orp.html index fadd649..1df3a03 100644 --- a/orp/orp_search/templates/orp.html +++ b/orp/orp_search/templates/orp.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% load service_problem_tags %} {% load url_replace_tags %} -{% block head_title %}{{service_name}}{% endblock %} +{% block head_title %}{% if is_paginated %}Page {{current_page}} - {% endif %}{{service_name}}{% endblock %} {% block service_name %}{{service_name}}{% endblock %} {% block body_content %}
@@ -204,11 +204,10 @@

{% if results %} - {{ results_total_count }} documents - {% else %} - {% if form.is_bound %} - No documents found + {% if is_paginated %} + {{ start_index }} to {{ end_index }} of {% endif %} + {{ results_total_count }} documents {% endif %}

@@ -234,20 +233,24 @@

-->
-
-
-
- - + + {% if results %} +
+
+
+ + +
-
-
+
+ {% endif %} +
{% if results %} @@ -321,14 +324,42 @@

{% endif %} {% else %} - {% if form.is_bound %} -

- We didn't find any regulations for that search. -

-

- Please try searching again using different search terms. -

- {% endif %} + {% if form.is_bound %} +

There are no matching results

+

+ Improve your search results by: +

+
    +
  • + removing filters +
  • +
  • + double-checking your spelling +
  • +
  • + using fewer keywords +
  • +
  • + searching for something less specific +
  • +
+

Related searches

+

+ Try these related search terms. +

+ + {% endif %} {% endif %}