Improve admin interface

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2023-04-03 19:13:15 +02:00
parent 073d761a03
commit b3c26b8c1c
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
7 changed files with 396 additions and 177 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: TFJM\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-03 17:59+0200\n"
"POT-Creation-Date: 2023-04-03 19:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Emmy D'Anello <emmy.danello@animath.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -21,19 +21,20 @@ msgstr ""
msgid "API"
msgstr "API"
#: draw/admin.py:16 draw/admin.py:28 draw/admin.py:44
#: draw/admin.py:16 draw/admin.py:28 draw/admin.py:44 participation/admin.py:44
#: participation/models.py:126 participation/tables.py:86
msgid "teams"
msgstr "équipes"
#: draw/admin.py:40 draw/admin.py:56 draw/models.py:17
#: participation/models.py:295 participation/models.py:319
#: participation/models.py:351
#: draw/admin.py:40 draw/admin.py:56 draw/models.py:18
#: participation/admin.py:16 participation/admin.py:73
#: participation/admin.py:104 participation/models.py:296
#: participation/models.py:320 participation/models.py:352
msgid "tournament"
msgstr "tournoi"
#: draw/admin.py:60 draw/models.py:157 draw/models.py:290
#: participation/models.py:355
#: draw/admin.py:60 draw/models.py:161 draw/models.py:294
#: participation/models.py:356
msgid "round"
msgstr "tour"
@ -96,124 +97,124 @@ msgstr ""
msgid "This is only available for the final tournament."
msgstr "Cela n'est possible que pour la finale."
#: draw/models.py:26
#: draw/models.py:27
msgid "current round"
msgstr "tour actuel"
#: draw/models.py:32
#: draw/models.py:33
msgid "last message"
msgstr "dernier message"
#: draw/models.py:114
#: draw/models.py:118
#, python-brace-format
msgid "Draw of tournament {tournament}"
msgstr "Tirage au sort du tournoi {tournament}"
#: draw/models.py:117 draw/models.py:125
#: draw/models.py:121 draw/models.py:129
msgid "draw"
msgstr "tirage au sort"
#: draw/models.py:118
#: draw/models.py:122
msgid "draws"
msgstr "tirages au sort"
#: draw/models.py:130
#: draw/models.py:134
msgid "Round 1"
msgstr "Tour 1"
#: draw/models.py:131
#: draw/models.py:135
msgid "Round 2"
msgstr "Tour 2"
#: draw/models.py:133
#: draw/models.py:137
msgid "number"
msgstr "numéro"
#: draw/models.py:142
#: draw/models.py:146
msgid "current pool"
msgstr "poule actuelle"
#: draw/models.py:158
#: draw/models.py:162
msgid "rounds"
msgstr "tours"
#: draw/models.py:175 participation/models.py:369
#: draw/models.py:179 participation/models.py:370
msgid "letter"
msgstr "lettre"
#: draw/models.py:179
#: draw/models.py:183
#: participation/templates/participation/tournament_detail.html:15
msgid "size"
msgstr "taille"
#: draw/models.py:188
#: draw/models.py:192
msgid "current team"
msgstr "équipe actuelle"
#: draw/models.py:197
#: draw/models.py:201
msgid "associated pool"
msgstr "poule associée"
#: draw/models.py:272
#: draw/models.py:276
#, python-brace-format
msgid "Pool {letter}{number}"
msgstr "Poule {letter}{number}"
#: draw/models.py:275 draw/models.py:298
#: draw/templates/draw/tournament_content.html:70 participation/models.py:417
#: participation/models.py:426 participation/tables.py:82
#: draw/models.py:279 draw/models.py:302 participation/admin.py:69
#: participation/admin.py:88 participation/models.py:418
#: participation/models.py:427 participation/tables.py:82
msgid "pool"
msgstr "poule"
#: draw/models.py:276 participation/models.py:418
#: draw/models.py:280 participation/models.py:419
msgid "pools"
msgstr "poules"
#: draw/models.py:284 participation/models.py:342 participation/models.py:550
#: participation/models.py:580 participation/models.py:618
#: draw/models.py:288 participation/models.py:343 participation/models.py:551
#: participation/models.py:581 participation/models.py:619
msgid "participation"
msgstr "participation"
#: draw/models.py:305
#: draw/models.py:309
msgid "passage index"
msgstr "numéro de passage"
#: draw/models.py:312
#: draw/models.py:316
msgid "choose index"
msgstr "numéro de choix"
#: draw/models.py:317 draw/models.py:340 participation/models.py:433
#: participation/models.py:587
#: draw/models.py:321 draw/models.py:344 participation/models.py:434
#: participation/models.py:588
#, python-brace-format
msgid "Problem #{problem}"
msgstr "Problème n°{problem}"
#: draw/models.py:321 draw/models.py:344
#: draw/models.py:325 draw/models.py:348
msgid "accepted problem"
msgstr "problème accepté"
#: draw/models.py:328
#: draw/models.py:332
msgid "passage dice"
msgstr "dé d'ordre de passage"
#: draw/models.py:335
#: draw/models.py:339
msgid "choice dice"
msgstr "dé d'ordre de choix"
#: draw/models.py:349
#: draw/models.py:353
msgid "rejected problems"
msgstr "problèmes rejetés"
#: draw/models.py:365
#: draw/models.py:369
#, python-brace-format
msgid "Draw of the team {trigram} for the pool {letter}{number}"
msgstr "Tirage de l'équipe {trigram} pour la poule {letter}{number}"
#: draw/models.py:371
#: draw/models.py:375
msgid "team draw"
msgstr "tirage d'équipe"
#: draw/models.py:372
#: draw/models.py:376
msgid "team draws"
msgstr "tirages d'équipe"
@ -261,8 +262,9 @@ msgstr "Exporter"
msgid "Continue draw"
msgstr "Continuer le tirage"
#: draw/templates/draw/tournament_content.html:192 participation/models.py:125
#: participation/models.py:310 registration/models.py:127
#: draw/templates/draw/tournament_content.html:192 participation/admin.py:100
#: participation/models.py:125 participation/models.py:311
#: registration/models.py:127
msgid "team"
msgstr "équipe"
@ -339,11 +341,34 @@ msgstr "changelogs"
msgid "Changelog of type \"{action}\" for model {model} at {timestamp}"
msgstr "Changelog de type \"{action}\" pour le modèle {model} le {timestamp}"
#: participation/admin.py:19 participation/models.py:325
#: participation/tables.py:43 registration/models.py:364
#: participation/admin.py:20 participation/models.py:326
#: participation/tables.py:43 registration/models.py:373
msgid "valid"
msgstr "valide"
#: participation/admin.py:24 participation/models.py:332
msgid "selected for final"
msgstr "sélectionnée pour la finale"
#: participation/admin.py:57 participation/admin.py:116
#: participation/models.py:441 participation/tables.py:109
msgid "defender"
msgstr "défenseur⋅se"
#: participation/admin.py:61 participation/models.py:448
#: participation/models.py:631
msgid "opponent"
msgstr "opposant⋅e"
#: participation/admin.py:65 participation/models.py:455
#: participation/models.py:632
msgid "reporter"
msgstr "rapporteur⋅e"
#: participation/admin.py:120 participation/models.py:586
msgid "problem"
msgstr "numéro de problème"
#: participation/forms.py:27
msgid "This name is already used."
msgstr "Ce nom est déjà utilisé."
@ -421,7 +446,7 @@ msgstr ""
msgid "This defender did not work on this problem."
msgstr "Ce⋅tte défenseur⋅se ne travaille pas sur ce problème."
#: participation/models.py:33 participation/models.py:135
#: participation/models.py:33 participation/models.py:136
#: participation/tables.py:17 participation/tables.py:33
msgid "name"
msgstr "nom"
@ -451,118 +476,114 @@ msgstr "lettre de motivation"
msgid "Team {name} ({trigram})"
msgstr "Équipe {name} ({trigram})"
#: participation/models.py:140
#: participation/models.py:141
msgid "start"
msgstr "début"
#: participation/models.py:145
#: participation/models.py:146
msgid "end"
msgstr "fin"
#: participation/models.py:151
#: participation/models.py:152
#: participation/templates/participation/tournament_detail.html:18
msgid "place"
msgstr "lieu"
#: participation/models.py:155
#: participation/models.py:156
msgid "max team count"
msgstr "nombre maximal d'équipes"
#: participation/models.py:160
#: participation/models.py:161
#: participation/templates/participation/tournament_detail.html:21
msgid "price"
msgstr "prix"
#: participation/models.py:165
#: participation/models.py:166
#: participation/templates/participation/tournament_detail.html:24
msgid "remote"
msgstr "à distance"
#: participation/models.py:170
#: participation/models.py:171
msgid "limit date for registrations"
msgstr "date limite d'inscription"
#: participation/models.py:175
#: participation/models.py:176
msgid "limit date to upload solutions"
msgstr "date limite pour envoyer les solutions"
#: participation/models.py:180
#: participation/models.py:181
msgid "random draw for solutions"
msgstr "tirage au sort des solutions"
#: participation/models.py:185
#: participation/models.py:186
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:190
#: participation/models.py:191
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:195
#: participation/models.py:196
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:200
#: participation/models.py:201
#: participation/templates/participation/tournament_detail.html:48
msgid "description"
msgstr "description"
#: participation/models.py:206
#: participation/models.py:207
#: participation/templates/participation/tournament_detail.html:12
msgid "organizers"
msgstr "organisateur⋅rices"
#: participation/models.py:211
#: participation/models.py:212
msgid "final"
msgstr "finale"
#: participation/models.py:296
#: participation/models.py:297 registration/admin.py:92
msgid "tournaments"
msgstr "tournois"
#: participation/models.py:326
#: participation/models.py:327
msgid "The participation got the validation of the organizers."
msgstr "La participation a été validée par les organisateur⋅rices."
#: participation/models.py:331
msgid "selected for final"
msgstr "sélectionnée pour la finale"
#: participation/models.py:332
#: participation/models.py:333
msgid "The team is selected for the final tournament."
msgstr "L'équipe est sélectionnée pour la finale."
#: participation/models.py:339
#: participation/models.py:340
#, python-brace-format
msgid "Participation of the team {name} ({trigram})"
msgstr "Participation de l'équipe {name} ({trigram})"
#: participation/models.py:343 participation/models.py:375
#: participation/models.py:344 participation/models.py:376
msgid "participations"
msgstr "participations"
#: participation/models.py:357 participation/models.py:358
#: participation/models.py:358 participation/models.py:359
#, python-brace-format
msgid "Round {round}"
msgstr "Tour {round}"
#: participation/models.py:381
#: participation/models.py:382
msgid "juries"
msgstr "jurys"
#: participation/models.py:388
#: participation/models.py:389
msgid "BigBlueButton URL"
msgstr "Lien BigBlueButton"
#: participation/models.py:389
#: participation/models.py:390
msgid "The link of the BBB visio for this pool."
msgstr "Le lien du salon BBB pour cette poule."
#: participation/models.py:394
#: participation/models.py:395
msgid "results available"
msgstr "résultats disponibles"
#: participation/models.py:395
#: participation/models.py:396
msgid ""
"Check this case when results become accessible to teams. They stay "
"accessible to you. Only averages are given."
@ -571,32 +592,20 @@ msgstr ""
"Ils restent toujours accessibles pour vous. Seules les moyennes sont "
"communiquées."
#: participation/models.py:411
#: participation/models.py:412
#, 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:431
#: participation/models.py:432
msgid "defended solution"
msgstr "solution défendue"
#: participation/models.py:440 participation/tables.py:109
msgid "defender"
msgstr "défenseur⋅se"
#: participation/models.py:447 participation/models.py:630
msgid "opponent"
msgstr "opposant⋅e"
#: participation/models.py:454 participation/models.py:631
msgid "reporter"
msgstr "rapporteur⋅e"
#: participation/models.py:459
#: participation/models.py:460
msgid "penalties"
msgstr "pénalités"
#: participation/models.py:461
#: participation/models.py:462
msgid ""
"Number of penalties for the defender. The defender will loose a 0.5 "
"coefficient per penalty."
@ -604,124 +613,120 @@ msgstr ""
"Nombre de pénalités pour læ défenseur⋅se. Læ défenseur⋅se perd un "
"coefficient 0.5 sur sa présentation orale par pénalité."
#: participation/models.py:521 participation/models.py:524
#: participation/models.py:527
#: participation/models.py:522 participation/models.py:525
#: participation/models.py:528
#, 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:532
#: participation/models.py:533
#, python-brace-format
msgid "Passage of {defender} for problem {problem}"
msgstr "Passage de {defender} pour le problème {problem}"
#: participation/models.py:536 participation/models.py:544
#: participation/models.py:625 participation/models.py:667
#: participation/models.py:537 participation/models.py:545
#: participation/models.py:626 participation/models.py:668
msgid "passage"
msgstr "passage"
#: participation/models.py:537
#: participation/models.py:538
msgid "passages"
msgstr "passages"
#: participation/models.py:555
#: participation/models.py:556
msgid "difference"
msgstr "différence"
#: participation/models.py:556
#: participation/models.py:557
msgid "Score to add/remove on the final score"
msgstr "Score à ajouter/retrancher au score final"
#: participation/models.py:563
#: participation/models.py:564
msgid "tweak"
msgstr "harmonisation"
#: participation/models.py:564
#: participation/models.py:565
msgid "tweaks"
msgstr "harmonisations"
#: participation/models.py:585
msgid "problem"
msgstr "numéro de problème"
#: participation/models.py:592
#: participation/models.py:593
msgid "solution for the final tournament"
msgstr "solution pour la finale"
#: participation/models.py:597 participation/models.py:636
#: participation/models.py:598 participation/models.py:637
msgid "file"
msgstr "fichier"
#: participation/models.py:603
#: participation/models.py:604
#, 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:605
#: participation/models.py:606
msgid "for final"
msgstr "pour la finale"
#: participation/models.py:608
#: participation/models.py:609
msgid "solution"
msgstr "solution"
#: participation/models.py:609
#: participation/models.py:610
msgid "solutions"
msgstr "solutions"
#: participation/models.py:642
#: participation/models.py:643
#, 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:650
#: participation/models.py:651
msgid "synthesis"
msgstr "note de synthèse"
#: participation/models.py:651
#: participation/models.py:652
msgid "syntheses"
msgstr "notes de synthèse"
#: participation/models.py:660
#: participation/models.py:661
msgid "jury"
msgstr "jury"
#: participation/models.py:672
#: participation/models.py:673
msgid "defender writing note"
msgstr "note d'écrit de læ défenseur⋅se"
#: participation/models.py:678
#: participation/models.py:679
msgid "defender oral note"
msgstr "note d'oral de læ défenseur⋅se"
#: participation/models.py:684
#: participation/models.py:685
msgid "opponent writing note"
msgstr "note d'écrit de l'opposant⋅e"
#: participation/models.py:690
#: participation/models.py:691
msgid "opponent oral note"
msgstr "note d'oral de l'opposant⋅e"
#: participation/models.py:696
#: participation/models.py:697
msgid "reporter writing note"
msgstr "note d'écrit de læ rapporteur⋅e"
#: participation/models.py:702
#: participation/models.py:703
msgid "reporter oral note"
msgstr "note d'oral de læ rapporteur⋅e"
#: participation/models.py:720
#: participation/models.py:721
#, python-brace-format
msgid "Notes of {jury} for {passage}"
msgstr "Notes de {jury} pour le {passage}"
#: participation/models.py:727
#: participation/models.py:728
msgid "note"
msgstr "note"
#: participation/models.py:728
#: participation/models.py:729
msgid "notes"
msgstr "notes"
@ -1414,6 +1419,16 @@ msgstr "Les notes ont bien été envoyées."
msgid "You can't upload a synthesis after the deadline."
msgstr "Vous ne pouvez pas envoyer de note de synthèse après la date limite."
#: registration/admin.py:21 registration/admin.py:36 registration/admin.py:52
#: registration/admin.py:68 registration/admin.py:84
msgid "first name"
msgstr "prénom"
#: registration/admin.py:25 registration/admin.py:40 registration/admin.py:56
#: registration/admin.py:72 registration/admin.py:88 registration/tables.py:17
msgid "last name"
msgstr "nom de famille"
#: registration/forms.py:22
msgid "role"
msgstr "rôle"
@ -1422,7 +1437,7 @@ msgstr "rôle"
msgid "participant"
msgstr "participant⋅e"
#: registration/forms.py:25 registration/models.py:281
#: registration/forms.py:25 registration/models.py:286
msgid "coach"
msgstr "encadrant⋅e"
@ -1451,7 +1466,7 @@ msgstr "email confirmé"
msgid "Activate your TFJM² account"
msgstr "Activez votre compte du TFJM²"
#: registration/models.py:99 registration/models.py:330
#: registration/models.py:99 registration/models.py:339
msgid "registration"
msgstr "inscription"
@ -1507,83 +1522,91 @@ msgstr ""
msgid "photo authorization"
msgstr "autorisation de droit à l'image"
#: registration/models.py:201
#: registration/models.py:196
msgid "participant registration"
msgstr "inscription de participant⋅e"
#: registration/models.py:197
msgid "participant registrations"
msgstr "inscriptions de participant⋅es"
#: registration/models.py:206
msgid "birth date"
msgstr "date de naissance"
#: registration/models.py:207
#: registration/models.py:212
msgid "12th grade"
msgstr "Terminale"
#: registration/models.py:208
#: registration/models.py:213
msgid "11th grade"
msgstr "Première"
#: registration/models.py:209
#: registration/models.py:214
msgid "10th grade or lower"
msgstr "Seconde ou inférieur"
#: registration/models.py:211
#: registration/models.py:216
msgid "student class"
msgstr "classe"
#: registration/models.py:216
#: registration/models.py:221
msgid "school"
msgstr "école"
#: registration/models.py:221
#: registration/models.py:226
msgid "responsible name"
msgstr "nom de læ responsable légal⋅e"
#: registration/models.py:226
#: registration/models.py:231
msgid "responsible phone number"
msgstr "numéro de téléphone de læ responsable légal⋅e"
#: registration/models.py:231
#: registration/models.py:236
msgid "responsible email address"
msgstr "adresse e-mail de læ responsable légal⋅e"
#: registration/models.py:236
#: registration/models.py:241
msgid "parental authorization"
msgstr "autorisation parentale"
#: registration/models.py:243
#: registration/models.py:248
msgid "health sheet"
msgstr "fiche sanitaire"
#: registration/models.py:250
#: registration/models.py:255
msgid "vaccine sheet"
msgstr "carnet de vaccination"
#: registration/models.py:258
#: registration/models.py:263
msgid "student"
msgstr "étudiant⋅e"
#: registration/models.py:266
#: registration/models.py:271
msgid "student registration"
msgstr "inscription d'élève"
#: registration/models.py:267
#: registration/models.py:272
msgid "student registrations"
msgstr "inscriptions d'élève"
#: registration/models.py:276 registration/models.py:298
#: registration/models.py:281 registration/models.py:303
msgid "professional activity"
msgstr "activité professionnelle"
#: registration/models.py:289
#: registration/models.py:294
msgid "coach registration"
msgstr "inscription d'encadrant⋅e"
#: registration/models.py:290
#: registration/models.py:295
msgid "coach registrations"
msgstr "inscriptions d'encadrant⋅es"
#: registration/models.py:302
#: registration/models.py:307
msgid "administrator"
msgstr "administrateur⋅rice"
#: registration/models.py:303
#: registration/models.py:308
msgid ""
"An administrator has all rights. Please don't give this right to all juries "
"and volunteers."
@ -1591,71 +1614,75 @@ 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:313
#: registration/models.py:318
msgid "admin"
msgstr "admin"
#: registration/models.py:313
#: registration/models.py:318
msgid "volunteer"
msgstr "bénévole"
#: registration/models.py:334
#: registration/models.py:326
msgid "volunteer registration"
msgstr "inscription de bénévole"
#: registration/models.py:327
msgid "volunteer registrations"
msgstr "inscriptions de bénévoles"
#: registration/models.py:343
msgid "type"
msgstr "type"
#: registration/models.py:337
#: registration/models.py:346
msgid "No payment"
msgstr "Pas de paiement"
#: registration/models.py:339
#: registration/models.py:348
msgid "Scholarship"
msgstr "Notification de bourse"
#: registration/models.py:340
#: registration/models.py:349
msgid "Bank transfer"
msgstr "Virement bancaire"
#: registration/models.py:341
#: registration/models.py:350
msgid "Other (please indicate)"
msgstr "Autre (veuillez spécifier)"
#: registration/models.py:342
#: registration/models.py:351
msgid "The tournament is free"
msgstr "Le tournoi est gratuit"
#: registration/models.py:349
#: registration/models.py:358
msgid "scholarship file"
msgstr "Notification de bourse"
#: registration/models.py:350
#: registration/models.py:359
msgid "only if you have a scholarship."
msgstr "Nécessaire seulement si vous déclarez être boursier."
#: registration/models.py:357
#: registration/models.py:366
msgid "additional information"
msgstr "informations additionnelles"
#: registration/models.py:358
#: registration/models.py:367
msgid "To help us to find your payment."
msgstr "Pour nous aider à retrouver votre paiement, si nécessaire."
#: registration/models.py:373
#: registration/models.py:382
#, python-brace-format
msgid "Payment of {registration}"
msgstr "Paiement de {registration}"
#: registration/models.py:376
#: registration/models.py:385
msgid "payment"
msgstr "paiement"
#: registration/models.py:377
#: registration/models.py:386
msgid "payments"
msgstr "paiements"
#: registration/tables.py:17
msgid "last name"
msgstr "nom de famille"
#: registration/templates/registration/add_organizer.html:5
#: registration/templates/registration/add_organizer.html:12
#: registration/templates/registration/add_organizer.html:21

View File

@ -9,56 +9,127 @@ from .models import Note, Participation, Passage, Pool, Solution, Synthesis, Tea
@admin.register(Team)
class TeamAdmin(admin.ModelAdmin):
list_display = ('name', 'trigram', 'valid',)
list_display = ('name', 'trigram', 'tournament', 'valid', 'final',)
search_fields = ('name', 'trigram',)
list_filter = ('participation__valid',)
list_filter = ('participation__valid', 'participation__tournament', 'participation__final',)
@admin.display(description=_("tournament"))
def tournament(self, record):
return record.participation.tournament
@admin.display(description=_("valid"), boolean=True)
def valid(self, team):
return team.participation.valid
valid.short_description = _('valid')
@admin.display(description=_("selected for final"), boolean=True)
def final(self, team):
return team.participation.final
@admin.register(Participation)
class ParticipationAdmin(admin.ModelAdmin):
list_display = ('team', 'valid',)
list_display = ('team', 'tournament', 'valid', 'final',)
search_fields = ('team__name', 'team__trigram',)
list_filter = ('valid',)
autocomplete_fields = ('team', 'tournament',)
@admin.register(Pool)
class PoolAdmin(admin.ModelAdmin):
list_display = ('__str__', 'tournament', 'round', 'letter', 'teams',)
list_filter = ('tournament', 'round', 'letter',)
search_fields = ('participations__team__name', 'participations__team__trigram',)
autocomplete_fields = ('tournament', 'participations', 'juries',)
@admin.display(description=_("teams"))
def teams(self, record: Pool):
return ', '.join(p.team.trigram for p in record.participations.all())
@admin.register(Passage)
class PassageAdmin(admin.ModelAdmin):
list_display = ('__str__', 'defender_trigram', 'solution_number', 'opponent_trigram', 'reporter_trigram',
'pool_abbr', 'tournament')
list_filter = ('pool__tournament', 'pool__round', 'pool__letter', 'solution_number',)
search_fields = ('pool__participations__team__name', 'pool__participations__team__trigram',)
autocomplete_fields = ('pool', 'defender', 'opponent', 'reporter',)
@admin.display(description=_("defender"))
def defender_trigram(self, record: Passage):
return record.defender.team.trigram
@admin.display(description=_("opponent"))
def opponent_trigram(self, record: Passage):
return record.opponent.team.trigram
@admin.display(description=_("reporter"))
def reporter_trigram(self, record: Passage):
return record.reporter.team.trigram
@admin.display(description=_("pool"))
def pool_abbr(self, record):
return f"{record.pool.get_letter_display()}{record.pool.round}"
@admin.display(description=_("tournament"))
def tournament(self, record: Passage):
return record.pool.tournament
@admin.register(Note)
class NoteAdmin(admin.ModelAdmin):
search_fields = ('jury',)
list_display = ('passage', 'pool', 'jury', 'defender_writing', 'defender_oral',
'opponent_writing', 'opponent_oral', 'reporter_writing', 'reporter_oral',)
list_filter = ('passage__pool__letter', 'passage__solution_number', 'jury',
'defender_writing', 'defender_oral', 'opponent_writing', 'opponent_oral',
'reporter_writing', 'reporter_oral')
search_fields = ('jury__user__last_name', 'jury__user__first_name', 'passage__defender__team__trigram',)
autocomplete_fields = ('jury', 'passage',)
@admin.display(description=_("pool"))
def pool(self, record):
return record.passage.pool.get_letter_display()
@admin.register(Solution)
class SolutionAdmin(admin.ModelAdmin):
list_display = ('participation',)
list_display = ('team', 'tournament', 'problem', 'final_solution',)
list_filter = ('problem', 'participation__tournament', 'final_solution',)
search_fields = ('participation__team__name', 'participation__team__trigram',)
autocomplete_fields = ('participation',)
@admin.display(ordering='participation__team', description=_("team"))
def team(self, record):
return record.participation.team
@admin.display(ordering='participation__tournament__name', description=_("tournament"))
def tournament(self, record):
return Tournament.final_tournament() if record.final_solution else record.participation.tournament
@admin.register(Synthesis)
class SynthesisAdmin(admin.ModelAdmin):
list_display = ('participation',)
list_display = ('participation', 'type', 'defender', 'passage',)
list_filter = ('participation__tournament', 'type', 'passage__solution_number',)
search_fields = ('participation__team__name', 'participation__team__trigram',)
autocomplete_fields = ('participation', 'passage',)
@admin.display(description=_("defender"))
def defender(self, record: Synthesis):
return record.passage.defender
@admin.display(description=_("problem"))
def problem(self, record: Synthesis):
return record.passage.solution_number
@admin.register(Tournament)
class TournamentAdmin(admin.ModelAdmin):
list_display = ('name',)
search_fields = ('name',)
autocomplete_fields = ('organizers',)
@admin.register(Tweak)
class TweakAdmin(admin.ModelAdmin):
list_display = ('participation', 'pool', 'diff',)
autocomplete_fields = ('participation', 'pool',)

View File

@ -0,0 +1,20 @@
# Generated by Django 4.1.7 on 2023-04-03 17:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("participation", "0004_alter_pool_options_pool_letter"),
]
operations = [
migrations.AlterModelOptions(
name="team",
options={
"ordering": ("trigram",),
"verbose_name": "team",
"verbose_name_plural": "teams",
},
),
]

View File

@ -124,6 +124,7 @@ class Team(models.Model):
class Meta:
verbose_name = _("team")
verbose_name_plural = _("teams")
ordering = ('trigram',)
indexes = [
Index(fields=("trigram", )),
]

View File

@ -3,31 +3,95 @@
from django.contrib import admin
from django.contrib.admin import ModelAdmin
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin
from django.utils.translation import gettext_lazy as _
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicChildModelFilter, PolymorphicParentModelAdmin
from .models import CoachRegistration, Payment, Registration, StudentRegistration, VolunteerRegistration
from .models import CoachRegistration, Payment, ParticipantRegistration, Registration, \
StudentRegistration, VolunteerRegistration
@admin.register(Registration)
class RegistrationAdmin(PolymorphicParentModelAdmin):
child_models = (StudentRegistration, CoachRegistration, VolunteerRegistration,)
list_display = ("user", "type", "email_confirmed",)
list_display = ('user', 'first_name', 'last_name', 'type', 'email_confirmed',)
list_filter = (PolymorphicChildModelFilter, 'email_confirmed',)
search_fields = ('user__first_name', 'user__last_name', 'user__email',)
polymorphic_list = True
@admin.display(description=_('first name'), ordering='user__first_name')
def first_name(self, record):
return record.user.first_name
@admin.display(description=_('last name'), ordering='user__last_name')
def last_name(self, record):
return record.user.last_name
@admin.register(ParticipantRegistration)
class ParticipantRegistrationAdmin(PolymorphicChildModelAdmin):
list_display = ('user', 'first_name', 'last_name', 'type', 'team', 'email_confirmed',)
list_filter = ('email_confirmed',)
search_fields = ('user__first_name', 'user__last_name', 'user__email',)
autocomplete_fields = ('user', 'team',)
@admin.display(description=_('first name'), ordering='user__first_name')
def first_name(self, record):
return record.user.first_name
@admin.display(description=_('last name'), ordering='user__last_name')
def last_name(self, record):
return record.user.last_name
@admin.register(StudentRegistration)
class StudentRegistrationAdmin(PolymorphicChildModelAdmin):
pass
list_display = ('user', 'first_name', 'last_name', 'team', 'email_confirmed',)
list_filter = ('email_confirmed',)
search_fields = ('user__first_name', 'user__last_name', 'user__email',)
autocomplete_fields = ('user', 'team',)
@admin.display(description=_('first name'), ordering='user__first_name')
def first_name(self, record):
return record.user.first_name
@admin.display(description=_('last name'), ordering='user__last_name')
def last_name(self, record):
return record.user.last_name
@admin.register(CoachRegistration)
class CoachRegistrationAdmin(PolymorphicChildModelAdmin):
pass
list_display = ('user', 'first_name', 'last_name', 'team', 'email_confirmed',)
list_filter = ('email_confirmed',)
search_fields = ('user__first_name', 'user__last_name', 'user__email',)
autocomplete_fields = ('user', 'team',)
@admin.display(description=_('first name'), ordering='user__first_name')
def first_name(self, record):
return record.user.first_name
@admin.display(description=_('last name'), ordering='user__last_name')
def last_name(self, record):
return record.user.last_name
@admin.register(VolunteerRegistration)
class VolunteerRegistrationAdmin(PolymorphicChildModelAdmin):
pass
list_display = ('user', 'first_name', 'last_name', 'tournaments', 'email_confirmed',)
list_filter = ('organized_tournaments', 'email_confirmed',)
search_fields = ('user__first_name', 'user__last_name', 'user__email',)
autocomplete_fields = ('user',)
@admin.display(description=_('first name'), ordering='user__first_name')
def first_name(self, record):
return record.user.first_name
@admin.display(description=_('last name'), ordering='user__last_name')
def last_name(self, record):
return record.user.last_name
@admin.display(description=_("tournaments"))
def tournaments(self, record):
return ', '.join(tr.name for tr in record.interesting_tournaments) or None
@admin.register(Payment)
@ -35,3 +99,4 @@ class PaymentAdmin(ModelAdmin):
list_display = ('registration', 'type', 'valid', )
search_fields = ('registration__user__last_name', 'registration__user__first_name', 'registration__user__email',)
list_filter = ('type', 'valid',)
autocomplete_fields = ('registration',)

View File

@ -0,0 +1,26 @@
# Generated by Django 4.1.7 on 2023-04-03 17:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("registration", "0006_alter_registration_polymorphic_ctype"),
]
operations = [
migrations.AlterModelOptions(
name="participantregistration",
options={
"verbose_name": "participant registration",
"verbose_name_plural": "participant registrations",
},
),
migrations.AlterModelOptions(
name="volunteerregistration",
options={
"verbose_name": "volunteer registration",
"verbose_name_plural": "volunteer registrations",
},
),
]

View File

@ -192,6 +192,11 @@ class ParticipantRegistration(Registration):
raise NotImplementedError
class Meta:
verbose_name = _("participant registration")
verbose_name_plural = _("participant registrations")
class StudentRegistration(ParticipantRegistration):
"""
Specific registration for students.
@ -317,6 +322,10 @@ class VolunteerRegistration(Registration):
from registration.forms import VolunteerRegistrationForm
return VolunteerRegistrationForm
class Meta:
verbose_name = _("volunteer registration")
verbose_name_plural = _("volunteer registrations")
def get_scholarship_filename(instance, filename):
return f"authorization/scholarship/scholarship_{instance.registration.pk}"