Enhance case search results display with additional information and tooltips for condition, presentation, and subspecialty

This commit is contained in:
Ross
2026-02-02 10:52:36 +00:00
parent 16865fab03
commit 22e5f9a496
2 changed files with 23 additions and 28 deletions
@@ -9,15 +9,15 @@
</div> </div>
<div class="mb-1"> <div class="mb-1">
<small class="text-muted me-2">{% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %}</small> <small class="text-muted me-2">{% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %}</small>
{% if case.condition %}<span class="badge bg-secondary me-1">{{ case.condition.name }}</span>{% endif %} {% if case.condition %}<span class="badge bg-secondary me-1" title="Condition: {{ case.condition.name }}">{{ case.condition.name }}</span>{% endif %}
{% if case.presentation %}<span class="badge bg-secondary me-1">{{ case.presentation.name }}</span>{% endif %} {% if case.presentation %}<span class="badge bg-secondary me-1" title="Presentation: {{ case.presentation.name }}">{{ case.presentation.name }}</span>{% endif %}
{% if case.subspecialty %}<span class="badge bg-secondary">{{ case.subspecialty.name }}</span>{% endif %} {% if case.subspecialty %}<span class="badge bg-secondary" title="Subspecialty: {{ case.subspecialty.name }}">{{ case.subspecialty.name }}</span>{% endif %}
</div> </div>
<div class="mb-1"> <div class="mb-1">
{# show up to three series modalities/examinations if present #} {# show up to three series modalities/examinations if present #}
{% for s in case.series.all|slice:":3" %} {% for s in case.series.all|slice:":3" %}
<span class="badge bg-light text-dark me-1"> <span class="badge bg-light text-dark me-1" title="Series: {% if s.modality %}{{ s.modality.modality }}{% endif %}{% if s.examination %} / {{ s.examination.examination }}{% endif %}">
{% if s.modality %}{{ s.modality.modality }}{% endif %} {% if s.modality %}{{ s.modality.modality }}{% endif %}
{% if s.examination %} / {{ s.examination.examination }}{% endif %} {% if s.examination %} / {{ s.examination.examination }}{% endif %}
</span> </span>
@@ -1,30 +1,25 @@
{# Search results #} {# Search results #}
{% if q %} {% if cases and cases|length > 0 %}
{% if cases and cases.exists %}
<div class="list-group mb-2"> <div class="list-group mb-2">
{% for case in cases %} {% for case in cases %}
<div class="list-group-item d-flex justify-content-between align-items-center" data-case-pk="{{ case.pk }}"> <a href="{% url 'atlas:case_detail' case.pk %}" class="list-group-item list-group-item-action">
<div class="flex-fill me-3"> <div class="d-flex w-100 justify-content-between">
<div class="fw-semibold">{{ case.title }}</div> <h6 class="mb-1">{{ case.title }}</h6>
<div class="small text-muted">{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}</div> <small class="text-muted">{{ case.created_date|date:"Y-m-d" }}</small>
</div> </div>
<div class="mb-1">
{% if collection %} <small class="text-muted me-2">{% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %}</small>
<form class="m-0" hx-post="{% url 'atlas:add_case_to_collection' collection.pk %}" hx-target="#full-question-list" hx-swap="beforeend"> {% if case.condition %}<span class="badge bg-secondary me-1" title="Condition: {{ case.condition.name }}">{{ case.condition.name }}</span>{% endif %}
{% csrf_token %} {% if case.presentation %}<span class="badge bg-secondary me-1" title="Presentation: {{ case.presentation.name }}">{{ case.presentation.name }}</span>{% endif %}
<input type="hidden" name="case" value="{{ case.pk }}"> {% if case.subspecialty %}<span class="badge bg-secondary" title="Subspecialty: {{ case.subspecialty.name }}">{{ case.subspecialty.name }}</span>{% endif %}
<button type="submit" class="btn btn-sm btn-primary">Add</button>
</form>
{% else %}
<a class="btn btn-sm btn-outline-secondary" href="{% url 'atlas:case_displaysets' case.pk %}">View</a>
{% endif %}
</div> </div>
<p class="mb-1 text-truncate">{% if case.description %}{{ case.description|truncatechars:140 }}{% endif %}</p>
</a>
{% endfor %} {% endfor %}
</div> </div>
{% else %} {% else %}
<div class="text-muted small mb-2">No cases found.</div> <div class="text-muted small mb-2">No cases found.</div>
{% endif %} {% endif %}
{% endif %}
{# Recent cases quick-add (rendered below search results) #} {# Recent cases quick-add (rendered below search results) #}
{% if recent_cases and recent_cases|length > 0 %} {% if recent_cases and recent_cases|length > 0 %}