From 712ecec25ddd966f60d209542305a384f5677401 Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 16 Nov 2025 23:25:35 +0000 Subject: [PATCH] Enhance case search results: add data attributes for case identification and implement client-side removal of cases from search results after addition to collection --- .../atlas/partials/case_search_results.html | 6 ++-- .../atlas/partials/case_search_widget.html | 29 +++++++++++++++++++ atlas/views.py | 15 +++++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/atlas/templates/atlas/partials/case_search_results.html b/atlas/templates/atlas/partials/case_search_results.html index cab4deba..284533a0 100644 --- a/atlas/templates/atlas/partials/case_search_results.html +++ b/atlas/templates/atlas/partials/case_search_results.html @@ -2,8 +2,8 @@ {% if q %} {% if cases and cases.exists %}
- {% for case in cases %} -
+ {% for case in cases %} +
{{ case.title }}
{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}
@@ -28,7 +28,7 @@
Recently created
{% for case in recent_cases %} -
+
{{ case.title }}
{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}
diff --git a/atlas/templates/atlas/partials/case_search_widget.html b/atlas/templates/atlas/partials/case_search_widget.html index f5d47134..28e7c5a2 100644 --- a/atlas/templates/atlas/partials/case_search_widget.html +++ b/atlas/templates/atlas/partials/case_search_widget.html @@ -15,3 +15,32 @@
+ + diff --git a/atlas/views.py b/atlas/views.py index be365e65..48e7926c 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -1169,7 +1169,20 @@ def add_case_to_collection(request, collection_id): }, request=request, ) - return HttpResponse(rendered) + # Also instruct the client to remove this case from any visible search/recent lists + remove_script = ( + '' + ) + + return HttpResponse(rendered + remove_script) # if request.method == "POST":