diff --git a/orp/config/urls.py b/orp/config/urls.py index 11130d6..6bdc50b 100644 --- a/orp/config/urls.py +++ b/orp/config/urls.py @@ -17,7 +17,7 @@ orp_search_views.download_search_csv, name="download_csv", ), - path("details/", orp_search_views.details, name="details"), + path("document/", orp_search_views.document, name="document"), path("healthcheck/", core_views.health_check, name="healthcheck"), path( "accessibility-statement/", diff --git a/orp/orp_search/templates/details.html b/orp/orp_search/templates/document.html similarity index 100% rename from orp/orp_search/templates/details.html rename to orp/orp_search/templates/document.html diff --git a/orp/orp_search/templates/orp.html b/orp/orp_search/templates/orp.html index 26ab42b..077ba0a 100644 --- a/orp/orp_search/templates/orp.html +++ b/orp/orp_search/templates/orp.html @@ -267,7 +267,7 @@

{{ result.document_type }}

- + {{result.title}}

diff --git a/orp/orp_search/views.py b/orp/orp_search/views.py index 4b744a6..2f77409 100644 --- a/orp/orp_search/views.py +++ b/orp/orp_search/views.py @@ -16,8 +16,8 @@ @require_http_methods(["GET"]) -def details(request: HttpRequest, id) -> HttpResponse: - """Details view. +def document(request: HttpRequest, id) -> HttpResponse: + """Document details view. Handles the GET request to fetch details based on the provided id. """ @@ -31,7 +31,7 @@ def details(request: HttpRequest, id) -> HttpResponse: logger.info("document id: %s", document_id) if not document_id: context["error"] = "no document id provided" - return render(request, template_name="details.html", context=context) + return render(request, template_name="document.html", context=context) # Create a SearchDocumentConfig instance and set the id parameter config = SearchDocumentConfig(search_terms="", dummy=True, id=document_id) @@ -53,11 +53,11 @@ def details(request: HttpRequest, id) -> HttpResponse: ].split("\n") context["result"] = search_result - return render(request, template_name="details.html", context=context) + return render(request, template_name="document.html", context=context) except Exception as e: logger.error("error fetching details: %s", e) context["error"] = f"error fetching details: {e}" - return render(request, template_name="details.html", context=context) + return render(request, template_name="document.html", context=context) @require_http_methods(["GET"])