From 4c1e0c3d2a8619714bc0ad6841b3694a6a95ac26 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 2 Mar 2026 12:23:51 +0000 Subject: [PATCH] Add case inline editing functionality and search widget improvements --- .../atlas/add_case_to_collection.html | 4 +- atlas/templates/atlas/case_display_block.html | 167 ++++++++++++++- .../atlas/partials/_case_search_results.html | 75 ++++--- .../atlas/partials/case_inline_field.html | 93 +++++++++ .../atlas/partials/case_search_results.html | 47 +++-- .../atlas/partials/case_search_widget.html | 28 +-- atlas/templates/atlas/user_uploads.html | 14 +- atlas/templatetags/__init__.py | 1 + atlas/templatetags/case_widgets.py | 38 ++++ atlas/urls.py | 1 + atlas/views.py | 192 +++++++++++++++++- 11 files changed, 575 insertions(+), 85 deletions(-) create mode 100644 atlas/templates/atlas/partials/case_inline_field.html create mode 100644 atlas/templatetags/__init__.py create mode 100644 atlas/templatetags/case_widgets.py diff --git a/atlas/templates/atlas/add_case_to_collection.html b/atlas/templates/atlas/add_case_to_collection.html index 6d6524f2..bc771ee2 100644 --- a/atlas/templates/atlas/add_case_to_collection.html +++ b/atlas/templates/atlas/add_case_to_collection.html @@ -1,7 +1,9 @@

Add an existing case to this collection. You can also use the case overview view to add multiple cases at once: case overview.

- {% include 'atlas/partials/case_search_widget.html' %} + {% load case_widgets %} + {% url 'atlas:add_case_to_collection' collection.pk as add_case_url %} + {% case_search_widget collection=collection cases=cases recent_cases=recent_cases selection_mode='multiple' action_url=add_case_url input_id='case-search-input-collection-'|add:collection.pk|stringformat:'s' target_id='case-search-results-collection-'|add:collection.pk|stringformat:'s' %}
diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 7e844ab4..1f286136 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -24,8 +24,91 @@ {% endfor %} {% endpartialdef %} + +
-

Case: {{ case.title }}

+

+ Case: +
+ {{ case.title }} + {% if can_edit %} + + {% endif %} +
+

{% if case.previous_case or case.next_case %}