Add toggle functionality for pre-review flag on case resources

This commit is contained in:
Ross
2025-12-15 11:15:56 +00:00
parent cbff1317d0
commit 4db1f2ca1a
3 changed files with 40 additions and 7 deletions
@@ -12,10 +12,11 @@
{% endif %}
</div>
{% if can_edit %}
<div>
<button type="button" class="btn btn-sm btn-outline-danger" hx-post="{% url 'atlas:case_detach_resource' pk=case.pk %}" hx-vals='{"resource_id": "{{ cr.resource.pk }}"}' hx-swap="outerHTML" hx-target="#case-resources-list">Remove</button>
</div>
{% endif %}
<div class="d-flex gap-2">
<button type="button" class="btn btn-sm btn-outline-secondary" title="Toggle pre/post" hx-post="{% url 'atlas:case_toggle_resource_pre' pk=case.pk %}" hx-vals='{"resource_id": "{{ cr.resource.pk }}"}' hx-swap="outerHTML" hx-target="#case-resources-list">Toggle</button>
<button type="button" class="btn btn-sm btn-outline-danger" hx-post="{% url 'atlas:case_detach_resource' pk=case.pk %}" hx-vals='{"resource_id": "{{ cr.resource.pk }}"}' hx-swap="outerHTML" hx-target="#case-resources-list">Remove</button>
</div>
{% endif %}
</li>
{% endfor %}
</ul>