1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 18:38:26 +02:00

Add confirmation modal before aborting a draw

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-04-05 18:41:28 +02:00
parent 7e212d011e
commit 746aae464a
2 changed files with 243 additions and 202 deletions

View File

@ -54,12 +54,6 @@
<div class="card">
<div class="card-header">
Recap
{% if user.registration.is_volunteer %}
{# Volunteers can click on this button to abort the draw #}
<button id="abort-{{ tournament.id }}" class="badge rounded-pill text-bg-danger" onclick="abortDraw({{ tournament.id }})">
{% trans "Abort" %}
</button>
{% endif %}
</div>
<div class="card-body">
<div id="recap-{{ tournament.id }}-round-list" class="row">
@ -327,3 +321,32 @@
</div>
</div>
</div>
{% if user.registration.is_volunteer %}
{# Volunteers can click on this button to abort the draw #}
<div class="text-center mt-3">
<button id="abort-{{ tournament.id }}" class="badge rounded-pill text-bg-danger" data-bs-toggle="modal" data-bs-target="#abort{{ tournament.id }}Modal">
{% trans "Abort" %}
</button>
</div>
{% endif %}
<div id="abort{{ tournament.id }}Modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% trans "Are you sure?" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{% trans "This will reset the draw from the beginning." %}
{% trans "This operation is irreversible." %}
{% trans "Are you sure you want to abort this draw?" %}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger" onclick="abortDraw({{ tournament.id }})">{% trans "Abort" %}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
</div>
</div>
</div>
</div>