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 class="mb-1">
<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.presentation %}<span class="badge bg-secondary me-1">{{ case.presentation.name }}</span>{% endif %}
{% if case.subspecialty %}<span class="badge bg-secondary">{{ case.subspecialty.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" title="Presentation: {{ case.presentation.name }}">{{ case.presentation.name }}</span>{% endif %}
{% if case.subspecialty %}<span class="badge bg-secondary" title="Subspecialty: {{ case.subspecialty.name }}">{{ case.subspecialty.name }}</span>{% endif %}
</div>
<div class="mb-1">
{# show up to three series modalities/examinations if present #}
{% 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.examination %} / {{ s.examination.examination }}{% endif %}
</span>
@@ -1,30 +1,25 @@
{# Search results #}
{% if q %}
{% if cases and cases.exists %}
{% if cases and cases|length > 0 %}
<div class="list-group mb-2">
{% for case in cases %}
<div class="list-group-item d-flex justify-content-between align-items-center" data-case-pk="{{ case.pk }}">
<div class="flex-fill me-3">
<div class="fw-semibold">{{ case.title }}</div>
<div class="small text-muted">{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}</div>
<a href="{% url 'atlas:case_detail' case.pk %}" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h6 class="mb-1">{{ case.title }}</h6>
<small class="text-muted">{{ case.created_date|date:"Y-m-d" }}</small>
</div>
{% if collection %}
<form class="m-0" hx-post="{% url 'atlas:add_case_to_collection' collection.pk %}" hx-target="#full-question-list" hx-swap="beforeend">
{% csrf_token %}
<input type="hidden" name="case" value="{{ case.pk }}">
<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 class="mb-1">
<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" title="Condition: {{ case.condition.name }}">{{ case.condition.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" title="Subspecialty: {{ case.subspecialty.name }}">{{ case.subspecialty.name }}</span>{% endif %}
</div>
<p class="mb-1 text-truncate">{% if case.description %}{{ case.description|truncatechars:140 }}{% endif %}</p>
</a>
{% endfor %}
</div>
{% else %}
<div class="text-muted small mb-2">No cases found.</div>
{% endif %}
{% endif %}
{# Recent cases quick-add (rendered below search results) #}
{% if recent_cases and recent_cases|length > 0 %}