feat: Allow toggling ongoing communication status

This commit is contained in:
2025-11-07 14:02:22 +01:00
parent 3b9ee95abc
commit 78b71690c0
2 changed files with 19 additions and 1 deletions

View File

@@ -71,7 +71,22 @@
value="{{ rescue_org.pk }}">
<input type="hidden" name="action" value="checked">
<button class="" type="submit">{% translate "Organisation geprüft" %}</button>
</form>
</div>
<div class="card-footer-item is-warning">
<form method="post">
{% csrf_token %}
<input type="hidden"
name="rescue_organization_id"
value="{{ rescue_org.pk }}">
<input type="hidden" name="action" value="toggle_active_communication">
<button class="" type="submit">
{% if rescue_org.ongoing_communication %}
{% translate "Aktive Kommunikation beendet" %}
{% else %}
{% translate "Aktive Kommunikation" %}
{% endif %}
</button>
</form>
</div>
<div class="card-footer-item is-danger">

View File

@@ -867,6 +867,9 @@ def rescue_organization_check(request, context=None):
if action == "checked":
rescue_org.set_checked()
Log.objects.create(user=request.user, action="rescue_organization_checked", )
elif action == "toggle_active_communication":
rescue_org.ongoing_communication = not rescue_org.ongoing_communication
rescue_org.save()
elif action == "set_species_url":
species_url_form = SpeciesURLForm(request.POST)