1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-08-06 15:08:12 +02:00

Ajout de la pop-up de validation de défi

This commit is contained in:
ikea
2025-08-06 08:20:43 +02:00
parent adc925e4b1
commit 4fa8ef4b56
2 changed files with 35 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ class FamilyAchievementTable(tables.Table):
class Meta:
model = Achievement
template_name = 'django_tables2/bootstrap4.html'
fields = ('challenge', 'challenge__points', 'obtained_at',)
fields = ('challenge', 'challenge__points', 'obtained_at', 'valid')
attrs = {
'class': 'table table-condensed table-striped table-hover'
}

View File

@@ -159,6 +159,34 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% render_table table %}
</div>
</div>
<!-- Popup de validation -->
<div class="modal fade" id="validationModal" tabindex="-1" role="dialog" aria-labelledby="validationModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content border-success">
<div class="modal-header bg-success text-white">
<h5 class="modal-title" id="validationModalLabel">{% trans "Challenge validated" %}</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p><strong>Are you sure you want to validate this challenge?</strong></p>
<p>To have your challenge officially validated, please send a message with:</p>
<ul>
<li>The name of the family</li>
<li>The name of the challenge</li>
<li>A photo or video as proof</li>
</ul>
<p><strong>Send it via WhatsApp to:</strong> +33 6 30 21 12 44</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">{% trans "OK" %}</button>
</div>
</div>
</div>
</div>
{% endblock %}
@@ -178,4 +206,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
});
{% endfor %}
</script>
<script>
document.getElementById("consume_all").addEventListener("click", function () {
$('#validationModal').modal('show');
});
</script>
</script>
{% endblock %}