add confirm call button

timetoconfirm
Raz 7 months ago
parent 3e0b51c4c9
commit 2c38ef7809
  1. 40
      tournaments/templates/tournaments/tournament_info.html
  2. 1
      tournaments/urls.py
  3. 15
      tournaments/views.py

@ -17,7 +17,6 @@
<div class="cell medium-6 large-6 padding10">
{% if tournament.enable_online_registration and team %}
<h1 class="club padding10 topmargin20">Votre équipe</h1 >
<div class="bubble">
{% if team.needs_confirmation %}
<div class="alert {% if team.get_confirmation_deadline %}alert-warning{% else %}alert-info{% endif %}">
@ -72,7 +71,7 @@
{% endif %}
</div>
<div class="semibold topmargin20">
<div class="semibold">
{% for player in team.players_sorted_by_rank %}
<div>{{ player.name }}</div>
{% endfor %}
@ -81,11 +80,38 @@
<p>
<div>Inscrits le {{ team.local_registration_date }}</div>
</p>
{% if team.call_date %}
<div class="topmargin20">
<h4 class="semibold">Convocation</h4>
<div>
Vous avez été convoqué(e)s le {{ team.local_call_date|date:"d/m/Y à H:i" }}
</div>
{% if team.confirmation_date %}
<div class="success-message">
<span class="icon"></span> Convocation confirmée le {{ team.confirmation_date|date:"d/m/Y à H:i" }}
</div>
{% else %}
<div>
Merci de confirmer la réception de votre convocation.
</div>
<form method="post" action="{% url 'confirm_call' tournament.id %}">
{% csrf_token %}
<button type="submit" class="rounded-button positive-button">
Confirmer la réception
</button>
</form>
{% endif %}
</div>
{% endif %}
<!-- Payment status information -->
{% if tournament.should_request_payment and team.is_in_waiting_list < 0 %}
<div style="margin-bottom: 40px;">
<div class="topmargin20">
<h4 class="semibold">Paiement</h4>
{% if team.is_paid %}
<div class="success-message topmargin20">
<div class="success-message">
<span class="icon"></span> Paiement confirmé
</div>
{% else %}
@ -113,12 +139,12 @@
{% endif %}
{% if tournament.is_unregistration_possible %}
<div class="topmargin20">
<div>
{% if tournament.is_refund_possible and team.is_paid %}
<p class="alert alert-info">
<p class="minor info">
Si vous vous désinscrivez, votre inscription sera remboursée automatiquement sur votre carte bancaire.
{% if tournament.refund_date_limit %}
<br><small>Remboursement possible jusqu'au {{ tournament.refund_date_limit|date:"d/m/Y à H:i" }}</small>
<div>Remboursement possible jusqu'au {{ tournament.refund_date_limit|date:"d/m/Y à H:i" }}</div>
{% endif %}
</p>
{% endif %}

@ -15,6 +15,7 @@ urlpatterns = [
path("c/<str:broadcast_code>", views.club_broadcast, name="club-broadcast"),
path("c/<str:broadcast_code>/go", views.club_broadcast_auto, name="club-broadcast-auto"),
path('tournaments/webhook/stripe/', payment_service.PaymentService.stripe_webhook, name='stripe_webhook'),
path('tournament/<str:tournament_id>/confirm-call/', views.confirm_call, name='confirm_call'),
path('tournaments/<str:tournament_id>/payment/success/', views.tournament_payment_success, name='tournament-payment-success'),
path('tournaments/<str:tournament_id>/proceed-to-payment/', views.proceed_to_payment, name='proceed_to_payment'),
path("tournament/<str:tournament_id>/",

@ -1475,6 +1475,21 @@ def cancel_registration(request, tournament_id):
messages.info(request, "Processus d'inscription annulé.")
return redirect('tournament-info', tournament_id=tournament_id)
@login_required
def confirm_call(request, tournament_id):
if request.method == 'POST':
tournament = get_object_or_404(Tournament, pk=tournament_id)
team = tournament.get_user_team_registration(request.user)
if team and team.call_date:
team.confirmation_date = timezone.now()
team.save()
# messages.success(request, 'Réception de la convocation confirmée.')
else:
messages.error(request, 'Une erreur est survenue.')
return redirect('tournament-info', tournament_id=tournament_id)
class UserListExportView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):
users = CustomUser.objects.order_by('date_joined')

Loading…
Cancel
Save