Add get_history method to CaseDetail model and update case_list_item template for history modal

This commit is contained in:
Ross
2026-02-08 21:42:17 +00:00
parent f3702db5f6
commit 1eeb0d89d9
2 changed files with 22 additions and 1 deletions
+7
View File
@@ -1627,6 +1627,13 @@ class CaseDetail(models.Model):
return self.case.history or "No history provided"
return ""
def get_history(self):
if self.redact_history:
return "[Redacted]"
if self.override_history and self.override_history != "":
return self.override_history
return self.case.history or "No history provided"
def get_case_series_nested(self, include_priors=True):
case_series_images = self.case.get_series_images_nested(as_json=False)
@@ -74,7 +74,21 @@
{# Pre-render hidden modal content for this case to avoid HTMX calls #}
<div class="d-none">
<div id="case-field-{{ casedetail.case.pk }}-history">
{% include 'atlas/partials/case_field_modal.html' with field='history' content=casedetail.get_history_pre %}
<div class="modal-header">
<h5 class="modal-title">History</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<br/>
{% if casedetail.get_history %}
<div class="pre-whitespace">{{ casedetail.get_history|linebreaks }}</div>
{% else %}
<div class="text-muted">No history available for this case.</div>
{% endif %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
<div id="case-field-{{ casedetail.case.pk }}-discussion">
{% include 'atlas/partials/case_field_modal.html' with field='discussion' content=casedetail.case.discussion %}