Display pending validations for organizers

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-02-11 22:39:11 +01:00
parent bc67d1cf1f
commit c1ce7cb70f
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 79 additions and 19 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: TFJM\n" "Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-11 22:18+0100\n" "POT-Creation-Date: 2024-02-11 22:35+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n" "Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -710,7 +710,7 @@ msgstr ""
"L'équipe {trigram} n'a pas encore été validée par les organisateurices. " "L'équipe {trigram} n'a pas encore été validée par les organisateurices. "
"Merci de patienter." "Merci de patienter."
#: participation/models.py:193 #: participation/models.py:193 registration/models.py:458
msgid "Pending validation" msgid "Pending validation"
msgstr "Validation en attente" msgstr "Validation en attente"
@ -1792,7 +1792,7 @@ msgstr ""
"avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur <a " "avez reçu par mail. Vous pouvez renvoyer un mail en cliquant sur <a "
"href=\"{send_email_url}\">ce lien</a>." "href=\"{send_email_url}\">ce lien</a>."
#: registration/models.py:118 registration/models.py:445 #: registration/models.py:118 registration/models.py:480
msgid "registration" msgid "registration"
msgstr "inscription" msgstr "inscription"
@ -2043,68 +2043,93 @@ msgstr "admin"
msgid "volunteer" msgid "volunteer"
msgstr "bénévole" msgstr "bénévole"
#: registration/models.py:432 #: registration/models.py:437
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."
#: registration/models.py:445
msgid "Registrations"
msgstr "Inscriptions"
#: registration/models.py:452
#, python-brace-format
msgid ""
"The team {trigram} requested to be validated for the tournament of "
"{tournament}. You can check the status of the team on the <a "
"href=\"{url}\">team page</a>."
msgstr ""
"L'équipe {trigram} a demandé à être validée pour le tournoi {tournament}. "
"Vous pouvez vérifier le statut de l'équipe sur la <a href=\"{url}\">page de "
"l'équipe</a>."
#: registration/models.py:467
msgid "volunteer registration" msgid "volunteer registration"
msgstr "inscription de bénévole" msgstr "inscription de bénévole"
#: registration/models.py:433 #: registration/models.py:468
msgid "volunteer registrations" msgid "volunteer registrations"
msgstr "inscriptions de bénévoles" msgstr "inscriptions de bénévoles"
#: registration/models.py:449 #: registration/models.py:484
msgid "type" msgid "type"
msgstr "type" msgstr "type"
#: registration/models.py:452 #: registration/models.py:487
msgid "No payment" msgid "No payment"
msgstr "Pas de paiement" msgstr "Pas de paiement"
#: registration/models.py:454 #: registration/models.py:489
msgid "Scholarship" msgid "Scholarship"
msgstr "Notification de bourse" msgstr "Notification de bourse"
#: registration/models.py:455 #: registration/models.py:490
msgid "Bank transfer" msgid "Bank transfer"
msgstr "Virement bancaire" msgstr "Virement bancaire"
#: registration/models.py:456 #: registration/models.py:491
msgid "Other (please indicate)" msgid "Other (please indicate)"
msgstr "Autre (veuillez spécifier)" msgstr "Autre (veuillez spécifier)"
#: registration/models.py:457 #: registration/models.py:492
msgid "The tournament is free" msgid "The tournament is free"
msgstr "Le tournoi est gratuit" msgstr "Le tournoi est gratuit"
#: registration/models.py:464 #: registration/models.py:499
msgid "scholarship file" msgid "scholarship file"
msgstr "Notification de bourse" msgstr "Notification de bourse"
#: registration/models.py:465 #: registration/models.py:500
msgid "only if you have a scholarship." msgid "only if you have a scholarship."
msgstr "Nécessaire seulement si vous déclarez être boursier." msgstr "Nécessaire seulement si vous déclarez être boursier."
#: registration/models.py:472 #: registration/models.py:507
msgid "additional information" msgid "additional information"
msgstr "informations additionnelles" msgstr "informations additionnelles"
#: registration/models.py:473 #: registration/models.py:508
msgid "To help us to find your payment." msgid "To help us to find your payment."
msgstr "Pour nous aider à retrouver votre paiement, si nécessaire." msgstr "Pour nous aider à retrouver votre paiement, si nécessaire."
#: registration/models.py:479 #: registration/models.py:514
msgid "payment valid" msgid "payment valid"
msgstr "paiement valide" msgstr "paiement valide"
#: registration/models.py:488 #: registration/models.py:523
#, python-brace-format #, python-brace-format
msgid "Payment of {registration}" msgid "Payment of {registration}"
msgstr "Paiement de {registration}" msgstr "Paiement de {registration}"
#: registration/models.py:491 #: registration/models.py:526
msgid "payment" msgid "payment"
msgstr "paiement" msgstr "paiement"
#: registration/models.py:492 #: registration/models.py:527
msgid "payments" msgid "payments"
msgstr "paiements" msgstr "paiements"

View File

@ -428,6 +428,41 @@ class VolunteerRegistration(Registration):
from registration.forms import VolunteerRegistrationForm from registration.forms import VolunteerRegistrationForm
return VolunteerRegistrationForm return VolunteerRegistrationForm
def important_informations(self):
informations = []
for tournament in self.organized_tournaments.all():
if timezone.now() < tournament.inscription_limit \
or tournament.participations.filter(valid=True).count() < tournament.max_teams:
text = _("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.")
content = format_lazy(text, tournament=tournament.name, date=tournament.inscription_limit,
validated_teams=tournament.participations.filter(valid=True).count(),
pending_teams=tournament.participations.filter(valid=False).count(),
max_teams=tournament.max_teams)
informations.append({
'title': _("Registrations"),
'type': "info",
'priority': 2,
'content': content,
})
for pending_participation in tournament.participations.filter(valid=False).all():
text = _("The team {trigram} requested to be validated for the tournament of {tournament}. "
"You can check the status of the team on the <a href=\"{url}\">team page</a>.")
url = reverse_lazy("participation:team_detail", args=(pending_participation.team.id,))
content = format_lazy(text, trigram=pending_participation.team.trigram,
tournament=tournament.name, url=url)
informations.append({
'title': _("Pending validation"),
'type': "warning",
'priority': 4,
'content': content,
})
return informations
class Meta: class Meta:
verbose_name = _("volunteer registration") verbose_name = _("volunteer registration")
verbose_name_plural = _("volunteer registrations") verbose_name_plural = _("volunteer registrations")