Refactor normal case toggle buttons for improved readability and structure

This commit is contained in:
Ross
2026-04-27 09:46:39 +01:00
parent 9bae94a595
commit 068dd3df80
@@ -4,8 +4,8 @@
{% if case.normal_case %}
<span class="badge bg-success">Normal</span>
<small class="text-muted">{{ case.normal_case.display_age }}</small>
<span>
{% if can_edit %}
{% if can_edit %}
<span>
<button class="btn btn-sm btn-outline-danger ms-2"
hx-post="{% url 'atlas:case_toggle_normal' case.pk %}"
hx-target="#normal-toggle-block"
@@ -13,17 +13,15 @@
hx-confirm="Unmark this case as normal?">
Unmark normal
</button>
{% endif %}
{% if request.user.is_superuser or can_edit or request.user in case.normal_case.author.all %}
<button class="btn btn-sm btn-outline-secondary ms-2"
hx-get="{% url 'atlas:case_normal_edit' case.normal_case.pk %}"
hx-target="body"
hx-swap="beforeend">
Edit Normal
</button>
{% endif %}
</span>
</span>
{% endif %}
{% else %}
{% if can_edit %}
<button class="btn btn-sm btn-outline-primary"
@@ -33,7 +31,7 @@
Mark as normal
</button>
{% else %}
<span class="text-muted">Normal status only editable by atlas editors or case authors</span>
<span class="badge bg-secondary">Not normal</span>
{% endif %}
{% endif %}
</div>