From 75d23c0ba995bac30207c541f0c79a6f16f30903 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 2 Feb 2026 10:56:02 +0000 Subject: [PATCH] Improve condition, presentation, and subspecialty badge rendering in case search results --- .../atlas/partials/_case_search_results.html | 15 ++++++++------- .../atlas/partials/case_search_results.html | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/atlas/templates/atlas/partials/_case_search_results.html b/atlas/templates/atlas/partials/_case_search_results.html index 4faf5886..77ddc41f 100644 --- a/atlas/templates/atlas/partials/_case_search_results.html +++ b/atlas/templates/atlas/partials/_case_search_results.html @@ -9,18 +9,19 @@
{% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %} - {% if case.condition %}{{ case.condition.name }}{% endif %} - {% if case.presentation %}{{ case.presentation.name }}{% endif %} - {% if case.subspecialty %}{{ case.subspecialty.name }}{% endif %} + {% if case.condition and case.condition.name %}{{ case.condition.name }}{% endif %} + {% if case.presentation and case.presentation.name %}{{ case.presentation.name }}{% endif %} + {% if case.subspecialty and case.subspecialty.name %}{{ case.subspecialty.name }}{% endif %}
{# show up to three series modalities/examinations if present #} {% for s in case.series.all|slice:":3" %} - - {% if s.modality %}{{ s.modality.modality }}{% endif %} - {% if s.examination %} / {{ s.examination.examination }}{% endif %} - + {% if s.modality and s.modality.modality or s.examination and s.examination.examination %} + + {% if s.modality and s.modality.modality %}{{ s.modality.modality }}{% endif %}{% if s.examination and s.examination.examination %}{% if s.modality and s.modality.modality %} / {% endif %}{{ s.examination.examination }}{% endif %} + + {% endif %} {% empty %} No series {% endfor %} diff --git a/atlas/templates/atlas/partials/case_search_results.html b/atlas/templates/atlas/partials/case_search_results.html index fd0f40bb..9758acf3 100644 --- a/atlas/templates/atlas/partials/case_search_results.html +++ b/atlas/templates/atlas/partials/case_search_results.html @@ -9,9 +9,9 @@
{% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %} - {% if case.condition %}{{ case.condition.name }}{% endif %} - {% if case.presentation %}{{ case.presentation.name }}{% endif %} - {% if case.subspecialty %}{{ case.subspecialty.name }}{% endif %} + {% if case.condition and case.condition.name %}{{ case.condition.name }}{% endif %} + {% if case.presentation and case.presentation.name %}{{ case.presentation.name }}{% endif %} + {% if case.subspecialty and case.subspecialty.name %}{{ case.subspecialty.name }}{% endif %}

{% if case.description %}{{ case.description|truncatechars:140 }}{% endif %}