Refactor case management links and button structure for improved readability and consistency

This commit is contained in:
Ross
2026-02-09 11:24:43 +00:00
parent 25e5ef78ed
commit 45e01a78c1
2 changed files with 71 additions and 71 deletions
@@ -24,46 +24,46 @@
</div>
<div class="btn-group btn-group-sm ms-2" role="group" aria-label="case-field-links">
<div class="btn-group btn-group-sm ms-2" role="group" aria-label="case-field-links">
<!-- History button: opens modal populated from hidden content on page -->
{% if casedetail.case.history %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-history').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View history">
<i class="bi bi-clock-history text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No history">
<i class="bi bi-clock-history text-muted"></i>
</a>
{% endif %}
{% if casedetail.case.history %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-history').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View history">
<i class="bi bi-clock-history text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No history">
<i class="bi bi-clock-history text-muted"></i>
</a>
{% endif %}
<!-- Discussion button -->
{% if casedetail.case.discussion %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-discussion').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View discussion">
<i class="bi bi-chat-left-text text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No discussion">
<i class="bi bi-chat-left-text text-muted"></i>
</a>
{% endif %}
{% if casedetail.case.discussion %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-discussion').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View discussion">
<i class="bi bi-chat-left-text text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No discussion">
<i class="bi bi-chat-left-text text-muted"></i>
</a>
{% endif %}
<!-- Report button -->
{% if casedetail.case.report %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-report').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View report">
<i class="bi bi-file-earmark-text text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No report">
<i class="bi bi-file-earmark-text text-muted"></i>
</a>
{% endif %}
</div>
{% if casedetail.case.report %}
<a class="btn btn-outline-secondary" href="#"
onclick="document.querySelector('#case-field-modal .modal-content').innerHTML = document.getElementById('case-field-{{ casedetail.case.pk }}-report').innerHTML;"
data-bs-toggle="modal" data-bs-target="#case-field-modal" title="View report">
<i class="bi bi-file-earmark-text text-primary"></i>
</a>
{% else %}
<a class="btn btn-outline-secondary disabled" aria-disabled="true" href="javascript:void(0);" title="No report">
<i class="bi bi-file-earmark-text text-muted"></i>
</a>
{% endif %}
</div>
</div>
@@ -1,44 +1,44 @@
<div class="btn-group btn-group-sm me-2" role="group" aria-label="management-actions">
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_displaysetup_legacy' collection.pk casedetail.case.pk %}" title="Setup default display">
<i class="bi bi-display"></i>
<div class="btn-group btn-group-sm me-2" role="group" aria-label="management-actions">
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_displaysetup_legacy' collection.pk casedetail.case.pk %}" title="Setup default display">
<i class="bi bi-display"></i>
</a>
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_details_legacy' collection.pk casedetail.case.pk %}" title="Case details">
<i class="bi bi-info-square"></i>
</a>
{% if collection.collection_type == "QUE" %}
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_questions_legacy" collection.pk casedetail.case.pk %}' title="Manage questions">
{% if casedetail.question_schema %}
<i class="bi bi-question-square text-success"></i>
{% else %}
<i class="bi bi-question-square text-danger"></i>
{% endif %}
</a>
{% endif %}
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_details_legacy' collection.pk casedetail.case.pk %}" title="Case details">
<i class="bi bi-info-square"></i>
{% if casedetail.case.previous_case %}
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_priors_legacy" collection.pk casedetail.case.pk %}' title="Manage priors">
<i class="bi bi-link-45deg"></i>
</a>
{% endif %}
</div>
{% if collection.collection_type == "QUE" %}
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_questions_legacy" collection.pk casedetail.case.pk %}' title="Manage questions">
{% if casedetail.question_schema %}
<i class="bi bi-question-square text-success"></i>
{% else %}
<i class="bi bi-question-square text-danger"></i>
{% endif %}
</a>
{% endif %}
{% if casedetail.case.previous_case %}
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_priors_legacy" collection.pk casedetail.case.pk %}' title="Manage priors">
<i class="bi bi-link-45deg"></i>
</a>
{% endif %}
</div>
<div class="btn-group btn-group-sm" role="group" aria-label="status-indicator">
{% if casedetail.default_viewerstate %}
<button type="button" class="btn btn-sm btn-outline-success" aria-disabled="true" title="This case has a default viewerstate defined">
<i class="bi bi-check"></i>
</button>
{% endif %}
</div>
<div class="btn-group btn-group-sm" role="group" aria-label="status-indicator">
{% if casedetail.default_viewerstate %}
<button type="button" class="btn btn-sm btn-outline-success" aria-disabled="true" title="This case has a default viewerstate defined">
<i class="bi bi-check"></i>
</button>
{% endif %}
</div>
{# Remove button (HTMX) - only shown when the surrounding template has `can_edit` true #}
{% if can_edit %}
<form class="d-inline ms-2 m-0" hx-post="{% url 'atlas:remove_case_from_collection' casedetail.case.pk collection.pk %}" hx-target="closest li" hx-swap="outerHTML" hx-confirm="Remove this case from the collection?">
<button type="submit" class="btn btn-outline-danger btn-sm case-remove" title="Remove this case from the collection">
<i class="bi bi-trash"></i>
</button>
</form>
{% endif %}
{% if can_edit %}
<form class="d-inline ms-2 m-0" hx-post="{% url 'atlas:remove_case_from_collection' casedetail.case.pk collection.pk %}" hx-target="closest li" hx-swap="outerHTML" hx-confirm="Remove this case from the collection?">
<button type="submit" class="btn btn-outline-danger btn-sm case-remove" title="Remove this case from the collection">
<i class="bi bi-trash"></i>
</button>
</form>
{% endif %}