From 850659bf489673229c709d4884778af429e132de Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sun, 11 Feb 2024 23:31:24 +0100 Subject: [PATCH] Display payment information on the sidebar Signed-off-by: Emmy D'Anello --- locale/fr/LC_MESSAGES/django.po | 313 +++++++++++++++++++------------- participation/models.py | 40 +++- registration/models.py | 23 +++ 3 files changed, 246 insertions(+), 130 deletions(-) diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index db39ae5..c82270b 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: TFJM\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-11 22:35+0100\n" +"POT-Creation-Date: 2024-02-11 23:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Emmy D'Anello \n" "Language-Team: LANGUAGE \n" @@ -22,19 +22,19 @@ msgid "API" msgstr "API" #: draw/admin.py:16 draw/admin.py:28 draw/admin.py:44 participation/admin.py:44 -#: participation/models.py:248 participation/tables.py:87 +#: participation/models.py:250 participation/tables.py:87 msgid "teams" msgstr "équipes" #: draw/admin.py:40 draw/admin.py:56 draw/models.py:24 #: participation/admin.py:16 participation/admin.py:73 -#: participation/admin.py:104 participation/models.py:417 -#: participation/models.py:441 participation/models.py:474 +#: participation/admin.py:104 participation/models.py:419 +#: participation/models.py:443 participation/models.py:512 msgid "tournament" msgstr "tournoi" #: draw/admin.py:60 draw/models.py:231 draw/models.py:426 -#: participation/models.py:478 +#: participation/models.py:516 msgid "round" msgstr "tour" @@ -168,7 +168,7 @@ msgstr "La poule en cours, où les équipes choisissent leurs problèmes" msgid "rounds" msgstr "tours" -#: draw/models.py:254 participation/models.py:492 +#: draw/models.py:254 participation/models.py:530 msgid "letter" msgstr "lettre" @@ -207,17 +207,17 @@ msgid "Pool {letter}{number}" msgstr "Poule {letter}{number}" #: draw/models.py:407 draw/models.py:434 participation/admin.py:69 -#: participation/admin.py:88 participation/models.py:544 -#: participation/models.py:553 participation/tables.py:83 +#: participation/admin.py:88 participation/models.py:582 +#: participation/models.py:591 participation/tables.py:83 msgid "pool" msgstr "poule" -#: draw/models.py:408 participation/models.py:545 +#: draw/models.py:408 participation/models.py:583 msgid "pools" msgstr "poules" -#: draw/models.py:420 participation/models.py:464 participation/models.py:714 -#: participation/models.py:744 participation/models.py:782 +#: draw/models.py:420 participation/models.py:502 participation/models.py:752 +#: participation/models.py:782 participation/models.py:820 msgid "participation" msgstr "participation" @@ -241,8 +241,8 @@ msgid "" msgstr "" "L'ordre de choix dans la poule, entre 0 et la taille de la poule moins 1." -#: draw/models.py:457 draw/models.py:480 participation/models.py:567 -#: participation/models.py:751 +#: draw/models.py:457 draw/models.py:480 participation/models.py:605 +#: participation/models.py:789 #, python-brace-format msgid "Problem #{problem}" msgstr "Problème n°{problem}" @@ -325,7 +325,7 @@ msgid "Continue draw" msgstr "Continuer le tirage" #: draw/templates/draw/tournament_content.html:216 participation/admin.py:100 -#: participation/models.py:247 participation/models.py:432 +#: participation/models.py:249 participation/models.py:434 #: registration/models.py:146 msgid "team" msgstr "équipe" @@ -442,26 +442,26 @@ msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}" msgid "valid" msgstr "valide" -#: participation/admin.py:24 participation/models.py:453 +#: participation/admin.py:24 participation/models.py:455 msgid "selected for final" msgstr "sélectionnée pour la finale" #: participation/admin.py:57 participation/admin.py:116 -#: participation/models.py:574 participation/tables.py:111 +#: participation/models.py:612 participation/tables.py:111 msgid "defender" msgstr "défenseur⋅se" -#: participation/admin.py:61 participation/models.py:581 -#: participation/models.py:794 +#: participation/admin.py:61 participation/models.py:619 +#: participation/models.py:832 msgid "opponent" msgstr "opposant⋅e" -#: participation/admin.py:65 participation/models.py:588 -#: participation/models.py:795 +#: participation/admin.py:65 participation/models.py:626 +#: participation/models.py:833 msgid "reporter" msgstr "rapporteur⋅e" -#: participation/admin.py:120 participation/models.py:749 +#: participation/admin.py:120 participation/models.py:787 msgid "problem" msgstr "numéro de problème" @@ -484,13 +484,13 @@ msgstr "Aucune équipe n'a été trouvée avec ce code d'accès." #: participation/forms.py:86 participation/forms.py:351 #: registration/forms.py:122 registration/forms.py:144 #: registration/forms.py:166 registration/forms.py:188 -#: registration/forms.py:234 +#: registration/forms.py:235 msgid "The uploaded file size must be under 2 Mo." msgstr "Le fichier envoyé doit peser moins de 2 Mo." #: participation/forms.py:88 registration/forms.py:124 #: registration/forms.py:146 registration/forms.py:168 -#: registration/forms.py:190 registration/forms.py:236 +#: registration/forms.py:190 registration/forms.py:237 msgid "The uploaded file must be a PDF, PNG of JPEG file." msgstr "Le fichier envoyé doit être au format PDF, PNG ou JPEG." @@ -568,7 +568,7 @@ msgstr "Ce⋅tte défenseur⋅se ne travaille pas sur ce problème." msgid "The PDF file must not have more than 2 pages." msgstr "Le fichier PDF ne doit pas avoir plus de 2 pages." -#: participation/models.py:32 participation/models.py:258 +#: participation/models.py:32 participation/models.py:260 #: participation/tables.py:17 participation/tables.py:33 msgid "name" msgstr "nom" @@ -710,127 +710,163 @@ msgstr "" "L'équipe {trigram} n'a pas encore été validée par les organisateurices. " "Merci de patienter." -#: participation/models.py:193 registration/models.py:458 +#: participation/models.py:193 registration/models.py:481 msgid "Pending validation" msgstr "Validation en attente" -#: participation/models.py:244 +#: participation/models.py:246 #, python-brace-format msgid "Team {name} ({trigram})" msgstr "Équipe {name} ({trigram})" -#: participation/models.py:263 +#: participation/models.py:265 msgid "start" msgstr "début" -#: participation/models.py:268 +#: participation/models.py:270 msgid "end" msgstr "fin" -#: participation/models.py:274 +#: participation/models.py:276 #: participation/templates/participation/tournament_detail.html:18 msgid "place" msgstr "lieu" -#: participation/models.py:278 +#: participation/models.py:280 msgid "max team count" msgstr "nombre maximal d'équipes" -#: participation/models.py:283 +#: participation/models.py:285 #: participation/templates/participation/tournament_detail.html:21 msgid "price" msgstr "prix" -#: participation/models.py:288 +#: participation/models.py:290 #: participation/templates/participation/tournament_detail.html:24 msgid "remote" msgstr "à distance" -#: participation/models.py:293 +#: participation/models.py:295 msgid "limit date for registrations" msgstr "date limite d'inscription" -#: participation/models.py:298 +#: participation/models.py:300 msgid "limit date to upload solutions" msgstr "date limite pour envoyer les solutions" -#: participation/models.py:303 +#: participation/models.py:305 msgid "random draw for solutions" msgstr "tirage au sort des solutions" -#: participation/models.py:308 +#: participation/models.py:310 msgid "limit date to upload the syntheses for the first phase" msgstr "date limite pour envoyer les notes de synthèses pour la première phase" -#: participation/models.py:313 +#: participation/models.py:315 msgid "date when the solutions for the second round become available" msgstr "date à laquelle les solutions pour le second tour sont accessibles" -#: participation/models.py:318 +#: participation/models.py:320 msgid "limit date to upload the syntheses for the second phase" msgstr "date limite d'envoi des notes de synthèse pour la seconde phase" -#: participation/models.py:323 +#: participation/models.py:325 #: participation/templates/participation/tournament_detail.html:48 msgid "description" msgstr "description" -#: participation/models.py:329 +#: participation/models.py:331 #: participation/templates/participation/tournament_detail.html:12 msgid "organizers" msgstr "organisateur⋅rices" -#: participation/models.py:334 +#: participation/models.py:336 msgid "final" msgstr "finale" -#: participation/models.py:418 registration/admin.py:93 +#: participation/models.py:420 registration/admin.py:93 msgid "tournaments" msgstr "tournois" -#: participation/models.py:447 +#: participation/models.py:449 msgid "valid team" msgstr "équipe valide" -#: participation/models.py:448 +#: participation/models.py:450 msgid "The participation got the validation of the organizers." msgstr "La participation a été validée par les organisateur⋅rices." -#: participation/models.py:454 +#: participation/models.py:456 msgid "The team is selected for the final tournament." msgstr "L'équipe est sélectionnée pour la finale." -#: participation/models.py:461 +#: participation/models.py:463 #, python-brace-format msgid "Participation of the team {name} ({trigram})" msgstr "Participation de l'équipe {name} ({trigram})" -#: participation/models.py:465 participation/models.py:498 +#: participation/models.py:470 +#, python-brace-format +msgid "" +"

The team {trigram} has {nb_missing_payments} missing payments. Each " +"member of the team must have a valid payment (or send a scholarship " +"notification) to participate to the tournament.

Participants that have " +"not paid yet are: {participants}.

" +msgstr "" +"

L'équipe {trigram} a {nb_missing_payments} paiements manquants. Chaque " +"membre de l'équipe doit avoir un paiement valide (ou envoyer une notification " +"de bourse) pour participer au tournoi.

Les participant⋅es qui n'ont pas " +"encore payé sont : {participants}.

" + +#: participation/models.py:477 +msgid "Missing payments" +msgstr "Paiements manquants" + +#: participation/models.py:484 +msgid "" +"

The solutions for the tournament of {tournament} are due on the {date:%Y-" +"%m-%d %H:%M}.

You have currently sent {nb_solutions} " +"solutions. We suggest to send at least {min_solutions} " +"different solutions.

You can upload your solutions on your participation page.

" +msgstr "" +"

Les solutions pour le tournoi de {tournament} sont attendues pour le " +"{date:%d/%m/%Y %H:%M}.

Vous avez actuellement envoyé " +"{nb_solutions} solutions. Nous vous suggérons d'envoyer au " +"moins {min_solutions} solutions différentes.

Vous " +"pouvez envoyer vos solutions sur votre page de " +"participation.

" + +#: participation/models.py:493 +msgid "Solutions due" +msgstr "Rendu des solutions" + +#: participation/models.py:503 participation/models.py:536 msgid "participations" msgstr "participations" -#: participation/models.py:480 participation/models.py:481 +#: participation/models.py:518 participation/models.py:519 #, python-brace-format msgid "Round {round}" msgstr "Tour {round}" -#: participation/models.py:504 +#: participation/models.py:542 msgid "juries" msgstr "jurys" -#: participation/models.py:511 +#: participation/models.py:549 msgid "BigBlueButton URL" msgstr "Lien BigBlueButton" -#: participation/models.py:512 +#: participation/models.py:550 msgid "The link of the BBB visio for this pool." msgstr "Le lien du salon BBB pour cette poule." -#: participation/models.py:517 +#: participation/models.py:555 msgid "results available" msgstr "résultats disponibles" -#: participation/models.py:518 +#: participation/models.py:556 msgid "" "Check this case when results become accessible to teams. They stay " "accessible to you. Only averages are given." @@ -839,28 +875,28 @@ msgstr "" "Ils restent toujours accessibles pour vous. Seules les moyennes sont " "communiquées." -#: participation/models.py:538 +#: participation/models.py:576 #, python-brace-format msgid "Pool of day {round} for tournament {tournament} with teams {teams}" msgstr "Poule du jour {round} du tournoi {tournament} avec les équipes {teams}" -#: participation/models.py:558 +#: participation/models.py:596 msgid "position" msgstr "position" -#: participation/models.py:565 +#: participation/models.py:603 msgid "defended solution" msgstr "solution défendue" -#: participation/models.py:598 +#: participation/models.py:636 msgid "observer" msgstr "observateur⋅rice" -#: participation/models.py:603 +#: participation/models.py:641 msgid "penalties" msgstr "pénalités" -#: participation/models.py:605 +#: participation/models.py:643 msgid "" "Number of penalties for the defender. The defender will loose a 0.5 " "coefficient per penalty." @@ -868,124 +904,124 @@ msgstr "" "Nombre de pénalités pour l'équipe défenseuse. Elle perd un coefficient 0.5 " "sur sa présentation orale par pénalité." -#: participation/models.py:681 participation/models.py:684 -#: participation/models.py:687 participation/models.py:690 +#: participation/models.py:719 participation/models.py:722 +#: participation/models.py:725 participation/models.py:728 #, python-brace-format msgid "Team {trigram} is not registered in the pool." msgstr "L'équipe {trigram} n'est pas inscrite dans la poule." -#: participation/models.py:695 +#: participation/models.py:733 #, python-brace-format msgid "Passage of {defender} for problem {problem}" msgstr "Passage de {defender} pour le problème {problem}" -#: participation/models.py:699 participation/models.py:708 -#: participation/models.py:789 participation/models.py:831 +#: participation/models.py:737 participation/models.py:746 +#: participation/models.py:827 participation/models.py:869 msgid "passage" msgstr "passage" -#: participation/models.py:700 +#: participation/models.py:738 msgid "passages" msgstr "passages" -#: participation/models.py:719 +#: participation/models.py:757 msgid "difference" msgstr "différence" -#: participation/models.py:720 +#: participation/models.py:758 msgid "Score to add/remove on the final score" msgstr "Score à ajouter/retrancher au score final" -#: participation/models.py:727 +#: participation/models.py:765 msgid "tweak" msgstr "harmonisation" -#: participation/models.py:728 +#: participation/models.py:766 msgid "tweaks" msgstr "harmonisations" -#: participation/models.py:756 +#: participation/models.py:794 msgid "solution for the final tournament" msgstr "solution pour la finale" -#: participation/models.py:761 participation/models.py:800 +#: participation/models.py:799 participation/models.py:838 msgid "file" msgstr "fichier" -#: participation/models.py:767 +#: participation/models.py:805 #, python-brace-format msgid "Solution of team {team} for problem {problem}" msgstr "Solution de l'équipe {team} pour le problème {problem}" -#: participation/models.py:769 +#: participation/models.py:807 msgid "for final" msgstr "pour la finale" -#: participation/models.py:772 +#: participation/models.py:810 msgid "solution" msgstr "solution" -#: participation/models.py:773 +#: participation/models.py:811 msgid "solutions" msgstr "solutions" -#: participation/models.py:806 +#: participation/models.py:844 #, python-brace-format msgid "Synthesis of {team} as {type} for problem {problem} of {defender}" msgstr "" "Note de synthèse de l'équipe {team} en tant que {type} pour le problème " "{problem} de {defender}" -#: participation/models.py:814 +#: participation/models.py:852 msgid "synthesis" msgstr "note de synthèse" -#: participation/models.py:815 +#: participation/models.py:853 msgid "syntheses" msgstr "notes de synthèse" -#: participation/models.py:824 +#: participation/models.py:862 msgid "jury" msgstr "jury" -#: participation/models.py:836 +#: participation/models.py:874 msgid "defender writing note" msgstr "note d'écrit de la défense" -#: participation/models.py:842 +#: participation/models.py:880 msgid "defender oral note" msgstr "note d'oral de la défense" -#: participation/models.py:848 +#: participation/models.py:886 msgid "opponent writing note" msgstr "note d'écrit de l'opposition" -#: participation/models.py:854 +#: participation/models.py:892 msgid "opponent oral note" msgstr "note d'oral de l'opposition" -#: participation/models.py:860 +#: participation/models.py:898 msgid "reporter writing note" msgstr "note d'écrit du rapportage" -#: participation/models.py:866 +#: participation/models.py:904 msgid "reporter oral note" msgstr "note d'oral du rapportage" -#: participation/models.py:872 +#: participation/models.py:910 msgid "observer note" msgstr "note de l'observation" -#: participation/models.py:901 +#: participation/models.py:939 #, python-brace-format msgid "Notes of {jury} for {passage}" msgstr "Notes de {jury} pour le {passage}" -#: participation/models.py:908 +#: participation/models.py:946 msgid "note" msgstr "note" -#: participation/models.py:909 +#: participation/models.py:947 msgid "notes" msgstr "notes" @@ -1756,7 +1792,7 @@ msgstr "rôle" msgid "participant" msgstr "participant⋅e" -#: registration/forms.py:25 registration/models.py:392 +#: registration/forms.py:25 registration/models.py:415 msgid "coach" msgstr "encadrant⋅e" @@ -1764,7 +1800,7 @@ msgstr "encadrant⋅e" msgid "Pending" msgstr "En attente" -#: registration/forms.py:244 +#: registration/forms.py:245 msgid "You must upload your scholarship attestation." msgstr "Vous devez envoyer votre attestation de bourse." @@ -1792,7 +1828,7 @@ msgstr "" "avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur ce lien." -#: registration/models.py:118 registration/models.py:480 +#: registration/models.py:118 registration/models.py:503 msgid "registration" msgstr "inscription" @@ -1991,19 +2027,38 @@ msgstr "" msgid "Vaccine sheet" msgstr "Carnet de vaccination" -#: registration/models.py:369 +#: registration/models.py:368 +#, python-brace-format +msgid "" +"You have to pay {amount} € for your registration, or send a scholarship " +"notification or a payment proof. You can do it on the " +"payment page." +msgstr "" +"Vous devez payer {amount} € pour votre inscription, ou envoyer une " +"notification de bourse ou un justificatif de paiement. Vous pouvez le faire " +"sur la page de paiement." + +#: registration/models.py:374 registration/models.py:383 +msgid "Payment" +msgstr "Paiement" + +#: registration/models.py:380 +msgid "Your payment is under approval." +msgstr "Votre paiement est en cours de validation." + +#: registration/models.py:392 msgid "student registration" msgstr "inscription d'élève" -#: registration/models.py:370 +#: registration/models.py:393 msgid "student registrations" msgstr "inscriptions d'élève" -#: registration/models.py:381 +#: registration/models.py:404 msgid "most recent degree in mathematics, computer science or physics" msgstr "Dernier diplôme obtenu en mathématiques, informatique ou physique" -#: registration/models.py:382 +#: registration/models.py:405 msgid "" "Your most recent degree in maths, computer science or physics, or your last " "entrance exam (CAPES, Agrégation,…)" @@ -2011,23 +2066,23 @@ msgstr "" "Votre dernier diplôme en mathématiques, informatique ou physique, ou votre " "dernier concours obtenu (CAPES, Agrégation, …)" -#: registration/models.py:387 registration/models.py:409 +#: registration/models.py:410 registration/models.py:432 msgid "professional activity" msgstr "activité professionnelle" -#: registration/models.py:400 +#: registration/models.py:423 msgid "coach registration" msgstr "inscription d'encadrant⋅e" -#: registration/models.py:401 +#: registration/models.py:424 msgid "coach registrations" msgstr "inscriptions d'encadrant⋅es" -#: registration/models.py:413 +#: registration/models.py:436 msgid "administrator" msgstr "administrateur⋅rice" -#: registration/models.py:414 +#: registration/models.py:437 msgid "" "An administrator has all rights. Please don't give this right to all juries " "and volunteers." @@ -2035,29 +2090,29 @@ msgstr "" "Un⋅e administrateur⋅rice a tous les droits. Merci de ne pas donner ce droit " "à toustes les juré⋅es et bénévoles." -#: registration/models.py:424 +#: registration/models.py:447 msgid "admin" msgstr "admin" -#: registration/models.py:424 +#: registration/models.py:447 msgid "volunteer" msgstr "bénévole" -#: registration/models.py:437 +#: registration/models.py:460 msgid "" "Registrations for tournament {tournament} are closing on {date:%Y-%m-%d %H:" "%M}. There are for now {validated_teams} validated teams (+ {pending_teams} " "pending) on {max_teams} expected." msgstr "" "Les inscriptions pour le tournoi {tournament} ferment le {date:%d/%m/%Y à %H:" -"%M}. Il y a pour l'instant {validated_teams} équipes validées (+ {pending_" -"teams} en attente) sur {max_teams} attendues." +"%M}. Il y a pour l'instant {validated_teams} équipes validées (+ " +"{pending_teams} en attente) sur {max_teams} attendues." -#: registration/models.py:445 +#: registration/models.py:468 msgid "Registrations" msgstr "Inscriptions" -#: registration/models.py:452 +#: registration/models.py:475 #, python-brace-format msgid "" "The team {trigram} requested to be validated for the tournament of " @@ -2068,68 +2123,68 @@ msgstr "" "Vous pouvez vérifier le statut de l'équipe sur la page de " "l'équipe." -#: registration/models.py:467 +#: registration/models.py:490 msgid "volunteer registration" msgstr "inscription de bénévole" -#: registration/models.py:468 +#: registration/models.py:491 msgid "volunteer registrations" msgstr "inscriptions de bénévoles" -#: registration/models.py:484 +#: registration/models.py:507 msgid "type" msgstr "type" -#: registration/models.py:487 +#: registration/models.py:510 msgid "No payment" msgstr "Pas de paiement" -#: registration/models.py:489 +#: registration/models.py:512 msgid "Scholarship" msgstr "Notification de bourse" -#: registration/models.py:490 +#: registration/models.py:513 msgid "Bank transfer" msgstr "Virement bancaire" -#: registration/models.py:491 +#: registration/models.py:514 msgid "Other (please indicate)" msgstr "Autre (veuillez spécifier)" -#: registration/models.py:492 +#: registration/models.py:515 msgid "The tournament is free" msgstr "Le tournoi est gratuit" -#: registration/models.py:499 +#: registration/models.py:522 msgid "scholarship file" msgstr "Notification de bourse" -#: registration/models.py:500 +#: registration/models.py:523 msgid "only if you have a scholarship." msgstr "Nécessaire seulement si vous déclarez être boursier." -#: registration/models.py:507 +#: registration/models.py:530 msgid "additional information" msgstr "informations additionnelles" -#: registration/models.py:508 +#: registration/models.py:531 msgid "To help us to find your payment." msgstr "Pour nous aider à retrouver votre paiement, si nécessaire." -#: registration/models.py:514 +#: registration/models.py:537 msgid "payment valid" msgstr "paiement valide" -#: registration/models.py:523 +#: registration/models.py:546 #, python-brace-format msgid "Payment of {registration}" msgstr "Paiement de {registration}" -#: registration/models.py:526 +#: registration/models.py:549 msgid "payment" msgstr "paiement" -#: registration/models.py:527 +#: registration/models.py:550 msgid "payments" msgstr "paiements" @@ -2559,27 +2614,27 @@ msgstr "Détails de l'utilisateur⋅rice {user}" msgid "Update user {user}" msgstr "Mise à jour de l'utilisateur⋅rice {user}" -#: registration/views.py:488 +#: registration/views.py:494 #, python-brace-format msgid "Photo authorization of {student}.{ext}" msgstr "Autorisation de droit à l'image de {student}.{ext}" -#: registration/views.py:511 +#: registration/views.py:517 #, python-brace-format msgid "Health sheet of {student}.{ext}" msgstr "Fiche sanitaire de {student}.{ext}" -#: registration/views.py:534 +#: registration/views.py:540 #, python-brace-format msgid "Vaccine sheet of {student}.{ext}" msgstr "Carnet de vaccination de {student}.{ext}" -#: registration/views.py:557 +#: registration/views.py:563 #, python-brace-format msgid "Parental authorization of {student}.{ext}" msgstr "Autorisation parentale de {student}.{ext}" -#: registration/views.py:579 +#: registration/views.py:585 #, python-brace-format msgid "Scholarship attestation of {user}.{ext}" msgstr "Notification de bourse de {user}.{ext}" diff --git a/participation/models.py b/participation/models.py index 0bdba63..ca983fd 100644 --- a/participation/models.py +++ b/participation/models.py @@ -14,7 +14,7 @@ from django.utils import timezone from django.utils.crypto import get_random_string from django.utils.text import format_lazy from django.utils.translation import gettext_lazy as _ -from registration.models import VolunteerRegistration +from registration.models import VolunteerRegistration, Payment from tfjm.lists import get_sympa_client @@ -195,6 +195,8 @@ class Team(models.Model): 'priority': 2, 'content': content, }) + else: + informations.extend(self.participation.important_informations()) return informations @@ -460,6 +462,42 @@ class Participation(models.Model): def __str__(self): return _("Participation of the team {name} ({trigram})").format(name=self.team.name, trigram=self.team.trigram) + def important_informations(self): + informations = [] + + missing_payments = Payment.objects.filter(registration__in=self.team.participants.all(), valid=False) + if missing_payments.exists(): + text = _("

The team {trigram} has {nb_missing_payments} missing payments. Each member of the team " + "must have a valid payment (or send a scholarship notification) " + "to participate to the tournament.

" + "

Participants that have not paid yet are: {participants}.

") + content = format_lazy(text, trigram=self.team.trigram, nb_missing_payments=missing_payments.count(), + participants=", ".join(str(p.registration) for p in missing_payments.all())) + informations.append({ + 'title': _("Missing payments"), + 'type': "danger", + 'priority': 10, + 'content': content, + }) + + if timezone.now() <= self.tournament.solution_limit: + text = _("

The solutions for the tournament of {tournament} are due on the {date:%Y-%m-%d %H:%M}.

" + "

You have currently sent {nb_solutions} solutions. " + "We suggest to send at least {min_solutions} different solutions.

" + "

You can upload your solutions on your participation page.

") + url = reverse_lazy("participation:participation_detail", args=(self.pk,)) + content = format_lazy(text, tournament=self.tournament.name, date=self.tournament.solution_limit, + nb_solutions=self.solutions.count(), min_solutions=len(settings.PROBLEMS) - 3, + url=url) + informations.append({ + 'title': _("Solutions due"), + 'type': "info", + 'priority': 1, + 'content': content, + }) + + return informations + class Meta: verbose_name = _("participation") verbose_name_plural = _("participations") diff --git a/registration/models.py b/registration/models.py index bf636eb..cb34b32 100644 --- a/registration/models.py +++ b/registration/models.py @@ -363,6 +363,29 @@ class StudentRegistration(ParticipantRegistration): 'content': content, }) + if self.team and self.team.participation.valid: + if self.payment.valid is False: + text = _("You have to pay {amount} € for your registration, or send a scholarship " + "notification or a payment proof. " + "You can do it on the payment page.") + url = reverse_lazy("registration:update_payment", args=(self.payment.id,)) + content = format_lazy(text, amount=self.team.participation.tournament.price, url=url) + informations.append({ + 'title': _("Payment"), + 'type': "danger", + 'priority': 3, + 'content': content, + }) + elif self.payment.valid is None: + text = _("Your payment is under approval.") + content = text + informations.append({ + 'title': _("Payment"), + 'type': "warning", + 'priority': 3, + 'content': content, + }) + return informations class Meta: