From f3702db5f6e351923db0b2d0047fc3cd8a2033fd Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 2 Feb 2026 22:39:49 +0000 Subject: [PATCH] Refactor case field buttons to use hidden modal content and remove unused endpoint --- .../atlas/partials/case_list_item.html | 67 ++++++++++++------- .../casedetails_management_links.html | 3 + atlas/urls.py | 5 -- atlas/views.py | 29 -------- 4 files changed, 46 insertions(+), 58 deletions(-) diff --git a/atlas/templates/atlas/partials/case_list_item.html b/atlas/templates/atlas/partials/case_list_item.html index 8dec3153..32aaae21 100644 --- a/atlas/templates/atlas/partials/case_list_item.html +++ b/atlas/templates/atlas/partials/case_list_item.html @@ -25,38 +25,44 @@
- {# History button: opens modal with history content #} - - {% if casedetail.case.history %} + + {% if casedetail.case.history %} + - {% else %} + + {% else %} + - {% endif %} - + + {% endif %} - {# Discussion button #} - - {% if casedetail.case.discussion %} + + {% if casedetail.case.discussion %} + - {% else %} + + {% else %} + - {% endif %} - + + {% endif %} - {# Report button #} - - {% if casedetail.case.report %} + + {% if casedetail.case.report %} + - {% else %} + + {% else %} + - {% endif %} - + + {% endif %}
@@ -65,4 +71,17 @@ {% include 'atlas/partials/casedetails_management_links.html' %} + {# Pre-render hidden modal content for this case to avoid HTMX calls #} +
+
+ {% include 'atlas/partials/case_field_modal.html' with field='history' content=casedetail.get_history_pre %} +
+
+ {% include 'atlas/partials/case_field_modal.html' with field='discussion' content=casedetail.case.discussion %} +
+
+ {% include 'atlas/partials/case_field_modal.html' with field='report' content=casedetail.case.report %} +
+
+ diff --git a/atlas/templates/atlas/partials/casedetails_management_links.html b/atlas/templates/atlas/partials/casedetails_management_links.html index 8cce6586..013b1634 100644 --- a/atlas/templates/atlas/partials/casedetails_management_links.html +++ b/atlas/templates/atlas/partials/casedetails_management_links.html @@ -23,6 +23,9 @@ {% endif %} + + +
{% if casedetail.default_viewerstate %}