Refactor case display to enhance layout and add subspecialty, pathological process, and diagnostic certainty badges

This commit is contained in:
Ross
2025-11-01 08:15:30 +00:00
parent 77edb83688
commit 0de7c345a2
+27 -21
View File
@@ -121,28 +121,34 @@
</div>
{% endif %}
<div>
<span class="id">
ID: {{ case.id }}
</span>
/
<span class="date">
{{ case.created_date|date:"d/m/Y" }}
</span>
<div class="clearfix mb-2">
<div class="float-start">
<span class="id">ID: {{ case.id }}</span>
<span class="mx-1">/</span>
<span class="date">{{ case.created_date|date:"d/m/Y" }}</span>
</div>
<div class="float-end text-end">
{# Subspecialty badges (preserve any anchor returned by get_link) #}
{% if case.subspecialty.all %}
{% for sub in case.subspecialty.all %}
<span class="badge bg-secondary ms-1">{{ sub.get_link|safe }}</span>
{% endfor %}
{% else %}
<span class="text-muted me-2">No subspecialty</span>
{% endif %}
{# Pathological process badges #}
{% if case.pathological_process.all %}
{% for p in case.pathological_process.all %}
<span class="badge bg-secondary ms-1">{{ p.get_link|safe }}</span>
{% endfor %}
{% endif %}
{# Diagnostic certainty as a badge #}
Diagnostic certainty: <span class="badge bg-info text-dark ms-2">{{ case.get_diagnostic_certainty_display }}</span>
</div>
</div>
Subspecialty:
<ul>
{% for sub in case.subspecialty.all %}
<li>{{sub.get_link}}</li>
{% endfor %}
</ul>
<b>Pathological Process:</b>
<ul>
{% for p in case.pathological_process.all %}
<li>{{p.get_link}}</li>
{% endfor %}
</ul>
<b>Diagnostic certainty:</b> {{case.get_diagnostic_certainty_display}}<br />
<details id="dicom-viewer-details">
<summary>Viewer</summary>