Add letter in pool display

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2023-03-31 17:23:40 +02:00
parent 14505260ff
commit 0fa76d6f25
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
8 changed files with 168 additions and 99 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 4.1.7 on 2023-03-31 15:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("draw", "0007_remove_teamdraw_last_dice_teamdraw_choice_dice_and_more"),
]
operations = [
migrations.AlterField(
model_name="pool",
name="letter",
field=models.PositiveSmallIntegerField(
choices=[(1, "A"), (2, "B"), (3, "C"), (4, "D")], verbose_name="letter"
),
),
]

View File

@ -166,6 +166,7 @@ class Pool(models.Model):
(1, 'A'), (1, 'A'),
(2, 'B'), (2, 'B'),
(3, 'C'), (3, 'C'),
(4, 'D'),
], ],
verbose_name=_('letter'), verbose_name=_('letter'),
) )
@ -224,6 +225,7 @@ class Pool(models.Model):
self.associated_pool = PPool.objects.create( self.associated_pool = PPool.objects.create(
tournament=self.round.draw.tournament, tournament=self.round.draw.tournament,
round=self.round.number, round=self.round.number,
letter=self.letter,
) )
self.associated_pool.juries.set(self.round.draw.tournament.organizers.all()) self.associated_pool.juries.set(self.round.draw.tournament.organizers.all())
tds = list(self.team_draws) tds = list(self.team_draws)

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: 2023-03-31 17:14+0200\n" "POT-Creation-Date: 2023-03-31 17:22+0200\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"
@ -117,7 +117,7 @@ msgstr "numéro"
msgid "current pool" msgid "current pool"
msgstr "poule actuelle" msgstr "poule actuelle"
#: draw/models.py:154 draw/models.py:283 participation/models.py:355 #: draw/models.py:154 draw/models.py:285 participation/models.py:355
msgid "round" msgid "round"
msgstr "tour" msgstr "tour"
@ -125,74 +125,74 @@ msgstr "tour"
msgid "rounds" msgid "rounds"
msgstr "tours" msgstr "tours"
#: draw/models.py:170 #: draw/models.py:171 participation/models.py:369
msgid "letter" msgid "letter"
msgstr "lettre" msgstr "lettre"
#: draw/models.py:174 #: draw/models.py:175
#: participation/templates/participation/tournament_detail.html:15 #: participation/templates/participation/tournament_detail.html:15
msgid "size" msgid "size"
msgstr "taille" msgstr "taille"
#: draw/models.py:183 #: draw/models.py:184
msgid "current team" msgid "current team"
msgstr "équipe actuelle" msgstr "équipe actuelle"
#: draw/models.py:192 #: draw/models.py:193
msgid "associated pool" msgid "associated pool"
msgstr "poule associée" msgstr "poule associée"
#: draw/models.py:269 draw/models.py:291 #: draw/models.py:271 draw/models.py:293
#: draw/templates/draw/tournament_content.html:70 #: draw/templates/draw/tournament_content.html:70
#: draw/templates/draw/tournament_content.html:185 participation/models.py:407 #: draw/templates/draw/tournament_content.html:185 participation/models.py:417
#: participation/models.py:415 #: participation/models.py:426 participation/tables.py:82
msgid "pool" msgid "pool"
msgstr "poule" msgstr "poule"
#: draw/models.py:270 participation/models.py:408 #: draw/models.py:272 participation/models.py:418
msgid "pools" msgid "pools"
msgstr "poules" msgstr "poules"
#: draw/models.py:277 participation/models.py:342 participation/models.py:539 #: draw/models.py:279 participation/models.py:342 participation/models.py:550
#: participation/models.py:569 participation/models.py:607 #: participation/models.py:580 participation/models.py:618
msgid "participation" msgid "participation"
msgstr "participation" msgstr "participation"
#: draw/models.py:298 #: draw/models.py:300
msgid "passage index" msgid "passage index"
msgstr "numéro de passage" msgstr "numéro de passage"
#: draw/models.py:305 #: draw/models.py:307
msgid "choose index" msgid "choose index"
msgstr "numéro de choix" msgstr "numéro de choix"
#: draw/models.py:310 draw/models.py:333 participation/models.py:422 #: draw/models.py:312 draw/models.py:335 participation/models.py:433
#: participation/models.py:576 #: participation/models.py:587
#, python-brace-format #, python-brace-format
msgid "Problem #{problem}" msgid "Problem #{problem}"
msgstr "Problème n°{problem}" msgstr "Problème n°{problem}"
#: draw/models.py:314 draw/models.py:337 #: draw/models.py:316 draw/models.py:339
msgid "accepted problem" msgid "accepted problem"
msgstr "problème accepté" msgstr "problème accepté"
#: draw/models.py:321 #: draw/models.py:323
msgid "passage dice" msgid "passage dice"
msgstr "dé d'ordre passage" msgstr "dé d'ordre passage"
#: draw/models.py:328 #: draw/models.py:330
msgid "choice dice" msgid "choice dice"
msgstr "dé d'ordre de choix" msgstr "dé d'ordre de choix"
#: draw/models.py:342 #: draw/models.py:344
msgid "rejected problems" msgid "rejected problems"
msgstr "problèmes rejetés" msgstr "problèmes rejetés"
#: draw/models.py:358 #: draw/models.py:360
msgid "team draw" msgid "team draw"
msgstr "tirage d'équipe" msgstr "tirage d'équipe"
#: draw/models.py:359 #: draw/models.py:361
msgid "team draws" msgid "team draws"
msgstr "tirages d'équipe" msgstr "tirages d'équipe"
@ -430,7 +430,7 @@ msgstr "lettre de motivation"
msgid "Team {name} ({trigram})" msgid "Team {name} ({trigram})"
msgstr "Équipe {name} ({trigram})" msgstr "Équipe {name} ({trigram})"
#: participation/models.py:126 participation/tables.py:82 #: participation/models.py:126 participation/tables.py:86
msgid "teams" msgid "teams"
msgstr "équipes" msgstr "équipes"
@ -520,7 +520,7 @@ msgstr "L'équipe est sélectionnée pour la finale."
msgid "Participation of the team {name} ({trigram})" msgid "Participation of the team {name} ({trigram})"
msgstr "Participation de l'équipe {name} ({trigram})" msgstr "Participation de l'équipe {name} ({trigram})"
#: participation/models.py:343 participation/models.py:365 #: participation/models.py:343 participation/models.py:375
msgid "participations" msgid "participations"
msgstr "participations" msgstr "participations"
@ -529,23 +529,23 @@ msgstr "participations"
msgid "Round {round}" msgid "Round {round}"
msgstr "Tour {round}" msgstr "Tour {round}"
#: participation/models.py:371 #: participation/models.py:381
msgid "juries" msgid "juries"
msgstr "jurys" msgstr "jurys"
#: participation/models.py:378 #: participation/models.py:388
msgid "BigBlueButton URL" msgid "BigBlueButton URL"
msgstr "Lien BigBlueButton" msgstr "Lien BigBlueButton"
#: participation/models.py:379 #: participation/models.py:389
msgid "The link of the BBB visio for this pool." msgid "The link of the BBB visio for this pool."
msgstr "Le lien du salon BBB pour cette poule." msgstr "Le lien du salon BBB pour cette poule."
#: participation/models.py:384 #: participation/models.py:394
msgid "results available" msgid "results available"
msgstr "résultats disponibles" msgstr "résultats disponibles"
#: participation/models.py:385 #: participation/models.py:395
msgid "" msgid ""
"Check this case when results become accessible to teams. They stay " "Check this case when results become accessible to teams. They stay "
"accessible to you. Only averages are given." "accessible to you. Only averages are given."
@ -554,32 +554,32 @@ msgstr ""
"Ils restent toujours accessibles pour vous. Seules les moyennes sont " "Ils restent toujours accessibles pour vous. Seules les moyennes sont "
"communiquées." "communiquées."
#: participation/models.py:401 #: participation/models.py:411
#, python-brace-format #, python-brace-format
msgid "Pool of day {round} for tournament {tournament} with teams {teams}" msgid "Pool of day {round} for tournament {tournament} with teams {teams}"
msgstr "Poule du jour {round} du tournoi {tournament} avec les équipes {teams}" msgstr "Poule du jour {round} du tournoi {tournament} avec les équipes {teams}"
#: participation/models.py:420 #: participation/models.py:431
msgid "defended solution" msgid "defended solution"
msgstr "solution défendue" msgstr "solution défendue"
#: participation/models.py:429 participation/tables.py:102 #: participation/models.py:440 participation/tables.py:109
msgid "defender" msgid "defender"
msgstr "défenseur⋅se" msgstr "défenseur⋅se"
#: participation/models.py:436 participation/models.py:619 #: participation/models.py:447 participation/models.py:630
msgid "opponent" msgid "opponent"
msgstr "opposant⋅e" msgstr "opposant⋅e"
#: participation/models.py:443 participation/models.py:620 #: participation/models.py:454 participation/models.py:631
msgid "reporter" msgid "reporter"
msgstr "rapporteur⋅e" msgstr "rapporteur⋅e"
#: participation/models.py:448 #: participation/models.py:459
msgid "penalties" msgid "penalties"
msgstr "pénalités" msgstr "pénalités"
#: participation/models.py:450 #: participation/models.py:461
msgid "" msgid ""
"Number of penalties for the defender. The defender will loose a 0.5 " "Number of penalties for the defender. The defender will loose a 0.5 "
"coefficient per penalty." "coefficient per penalty."
@ -587,124 +587,124 @@ msgstr ""
"Nombre de pénalités pour læ défenseur⋅se. Læ défenseur⋅se perd un " "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é." "coefficient 0.5 sur sa présentation orale par pénalité."
#: participation/models.py:510 participation/models.py:513 #: participation/models.py:521 participation/models.py:524
#: participation/models.py:516 #: participation/models.py:527
#, python-brace-format #, python-brace-format
msgid "Team {trigram} is not registered in the pool." msgid "Team {trigram} is not registered in the pool."
msgstr "L'équipe {trigram} n'est pas inscrite dans la poule." msgstr "L'équipe {trigram} n'est pas inscrite dans la poule."
#: participation/models.py:521 #: participation/models.py:532
#, python-brace-format #, python-brace-format
msgid "Passage of {defender} for problem {problem}" msgid "Passage of {defender} for problem {problem}"
msgstr "Passage de {defender} pour le problème {problem}" msgstr "Passage de {defender} pour le problème {problem}"
#: participation/models.py:525 participation/models.py:533 #: participation/models.py:536 participation/models.py:544
#: participation/models.py:614 participation/models.py:656 #: participation/models.py:625 participation/models.py:667
msgid "passage" msgid "passage"
msgstr "passage" msgstr "passage"
#: participation/models.py:526 #: participation/models.py:537
msgid "passages" msgid "passages"
msgstr "passages" msgstr "passages"
#: participation/models.py:544 #: participation/models.py:555
msgid "difference" msgid "difference"
msgstr "différence" msgstr "différence"
#: participation/models.py:545 #: participation/models.py:556
msgid "Score to add/remove on the final score" msgid "Score to add/remove on the final score"
msgstr "Score à ajouter/retrancher au score final" msgstr "Score à ajouter/retrancher au score final"
#: participation/models.py:552 #: participation/models.py:563
msgid "tweak" msgid "tweak"
msgstr "harmonisation" msgstr "harmonisation"
#: participation/models.py:553 #: participation/models.py:564
msgid "tweaks" msgid "tweaks"
msgstr "harmonisations" msgstr "harmonisations"
#: participation/models.py:574 #: participation/models.py:585
msgid "problem" msgid "problem"
msgstr "numéro de problème" msgstr "numéro de problème"
#: participation/models.py:581 #: participation/models.py:592
msgid "solution for the final tournament" msgid "solution for the final tournament"
msgstr "solution pour la finale" msgstr "solution pour la finale"
#: participation/models.py:586 participation/models.py:625 #: participation/models.py:597 participation/models.py:636
msgid "file" msgid "file"
msgstr "fichier" msgstr "fichier"
#: participation/models.py:592 #: participation/models.py:603
#, python-brace-format #, python-brace-format
msgid "Solution of team {team} for problem {problem}" msgid "Solution of team {team} for problem {problem}"
msgstr "Solution de l'équipe {team} pour le problème {problem}" msgstr "Solution de l'équipe {team} pour le problème {problem}"
#: participation/models.py:594 #: participation/models.py:605
msgid "for final" msgid "for final"
msgstr "pour la finale" msgstr "pour la finale"
#: participation/models.py:597 #: participation/models.py:608
msgid "solution" msgid "solution"
msgstr "solution" msgstr "solution"
#: participation/models.py:598 #: participation/models.py:609
msgid "solutions" msgid "solutions"
msgstr "solutions" msgstr "solutions"
#: participation/models.py:631 #: participation/models.py:642
#, python-brace-format #, python-brace-format
msgid "Synthesis of {team} as {type} for problem {problem} of {defender}" msgid "Synthesis of {team} as {type} for problem {problem} of {defender}"
msgstr "" msgstr ""
"Note de synthèse de l'équipe {team} en tant que {type} pour le problème " "Note de synthèse de l'équipe {team} en tant que {type} pour le problème "
"{problem} de {defender}" "{problem} de {defender}"
#: participation/models.py:639 #: participation/models.py:650
msgid "synthesis" msgid "synthesis"
msgstr "note de synthèse" msgstr "note de synthèse"
#: participation/models.py:640 #: participation/models.py:651
msgid "syntheses" msgid "syntheses"
msgstr "notes de synthèse" msgstr "notes de synthèse"
#: participation/models.py:649 #: participation/models.py:660
msgid "jury" msgid "jury"
msgstr "jury" msgstr "jury"
#: participation/models.py:661 #: participation/models.py:672
msgid "defender writing note" msgid "defender writing note"
msgstr "note d'écrit de læ défenseur⋅se" msgstr "note d'écrit de læ défenseur⋅se"
#: participation/models.py:667 #: participation/models.py:678
msgid "defender oral note" msgid "defender oral note"
msgstr "note d'oral de læ défenseur⋅se" msgstr "note d'oral de læ défenseur⋅se"
#: participation/models.py:673 #: participation/models.py:684
msgid "opponent writing note" msgid "opponent writing note"
msgstr "note d'écrit de l'opposant⋅e" msgstr "note d'écrit de l'opposant⋅e"
#: participation/models.py:679 #: participation/models.py:690
msgid "opponent oral note" msgid "opponent oral note"
msgstr "note d'oral de l'opposant⋅e" msgstr "note d'oral de l'opposant⋅e"
#: participation/models.py:685 #: participation/models.py:696
msgid "reporter writing note" msgid "reporter writing note"
msgstr "note d'écrit de læ rapporteur⋅e" msgstr "note d'écrit de læ rapporteur⋅e"
#: participation/models.py:691 #: participation/models.py:702
msgid "reporter oral note" msgid "reporter oral note"
msgstr "note d'oral de læ rapporteur⋅e" msgstr "note d'oral de læ rapporteur⋅e"
#: participation/models.py:709 #: participation/models.py:720
#, python-brace-format #, python-brace-format
msgid "Notes of {jury} for {passage}" msgid "Notes of {jury} for {passage}"
msgstr "Notes de {jury} pour le {passage}" msgstr "Notes de {jury} pour le {passage}"
#: participation/models.py:716 #: participation/models.py:727
msgid "note" msgid "note"
msgstr "note" msgstr "note"
#: participation/models.py:717 #: participation/models.py:728
msgid "notes" msgid "notes"
msgstr "notes" msgstr "notes"
@ -729,7 +729,12 @@ msgstr "date"
msgid "From {start} to {end}" msgid "From {start} to {end}"
msgstr "Du {start} au {end}" msgstr "Du {start} au {end}"
#: participation/tables.py:88 #: participation/tables.py:91
#, python-brace-format
msgid "Pool {letter}{round}"
msgstr "Poule {letter}{round}"
#: participation/tables.py:95
msgid "No defined team" msgid "No defined team"
msgstr "Pas d'équipe définie" msgstr "Pas d'équipe définie"
@ -782,9 +787,9 @@ msgstr "Rejoindre"
#: participation/templates/participation/passage_detail.html:46 #: participation/templates/participation/passage_detail.html:46
#: participation/templates/participation/passage_detail.html:102 #: participation/templates/participation/passage_detail.html:102
#: participation/templates/participation/passage_detail.html:108 #: participation/templates/participation/passage_detail.html:108
#: participation/templates/participation/pool_detail.html:55 #: participation/templates/participation/pool_detail.html:58
#: participation/templates/participation/pool_detail.html:74 #: participation/templates/participation/pool_detail.html:77
#: participation/templates/participation/pool_detail.html:79 #: participation/templates/participation/pool_detail.html:82
#: participation/templates/participation/team_detail.html:126 #: participation/templates/participation/team_detail.html:126
#: participation/templates/participation/team_detail.html:190 #: participation/templates/participation/team_detail.html:190
#: participation/templates/participation/tournament_form.html:12 #: participation/templates/participation/tournament_form.html:12
@ -848,7 +853,7 @@ msgstr "Envoyer une solution"
#: participation/templates/participation/participation_detail.html:59 #: participation/templates/participation/participation_detail.html:59
#: participation/templates/participation/passage_detail.html:114 #: participation/templates/participation/passage_detail.html:114
#: participation/templates/participation/pool_detail.html:84 #: participation/templates/participation/pool_detail.html:87
#: participation/templates/participation/team_detail.html:185 #: participation/templates/participation/team_detail.html:185
#: participation/templates/participation/upload_motivation_letter.html:13 #: participation/templates/participation/upload_motivation_letter.html:13
#: participation/templates/participation/upload_notes.html:12 #: participation/templates/participation/upload_notes.html:12
@ -958,55 +963,59 @@ msgid "Round:"
msgstr "Tour :" msgstr "Tour :"
#: participation/templates/participation/pool_detail.html:18 #: participation/templates/participation/pool_detail.html:18
msgid "Letter:"
msgstr "Lettre :"
#: participation/templates/participation/pool_detail.html:21
msgid "Teams:" msgid "Teams:"
msgstr "Équipes :" msgstr "Équipes :"
#: participation/templates/participation/pool_detail.html:25 #: participation/templates/participation/pool_detail.html:28
msgid "Juries:" msgid "Juries:"
msgstr "Jurys :" msgstr "Jurys :"
#: participation/templates/participation/pool_detail.html:28 #: participation/templates/participation/pool_detail.html:31
msgid "Defended solutions:" msgid "Defended solutions:"
msgstr "Solutions défendues :" msgstr "Solutions défendues :"
#: participation/templates/participation/pool_detail.html:35 #: participation/templates/participation/pool_detail.html:38
msgid "BigBlueButton link:" msgid "BigBlueButton link:"
msgstr "Lien BigBlueButton :" msgstr "Lien BigBlueButton :"
#: participation/templates/participation/pool_detail.html:41 #: participation/templates/participation/pool_detail.html:44
#: participation/templates/participation/tournament_detail.html:97 #: participation/templates/participation/tournament_detail.html:97
msgid "Ranking" msgid "Ranking"
msgstr "Classement" msgstr "Classement"
#: participation/templates/participation/pool_detail.html:54 #: participation/templates/participation/pool_detail.html:57
#: participation/templates/participation/pool_detail.html:68 #: participation/templates/participation/pool_detail.html:71
msgid "Add passage" msgid "Add passage"
msgstr "Ajouter un passage" msgstr "Ajouter un passage"
#: participation/templates/participation/pool_detail.html:56 #: participation/templates/participation/pool_detail.html:59
#: participation/templates/participation/pool_detail.html:78 #: participation/templates/participation/pool_detail.html:81
msgid "Update teams" msgid "Update teams"
msgstr "Modifier les équipes" msgstr "Modifier les équipes"
#: participation/templates/participation/pool_detail.html:57 #: participation/templates/participation/pool_detail.html:60
msgid "Upload notes from a CSV file" msgid "Upload notes from a CSV file"
msgstr "Soumettre les notes à partir d'un fichier CSV" msgstr "Soumettre les notes à partir d'un fichier CSV"
#: participation/templates/participation/pool_detail.html:64 #: participation/templates/participation/pool_detail.html:67
msgid "Passages" msgid "Passages"
msgstr "Passages" msgstr "Passages"
#: participation/templates/participation/pool_detail.html:69 #: participation/templates/participation/pool_detail.html:72
#: participation/templates/participation/tournament_detail.html:111 #: participation/templates/participation/tournament_detail.html:111
msgid "Add" msgid "Add"
msgstr "Ajouter" msgstr "Ajouter"
#: participation/templates/participation/pool_detail.html:73 #: participation/templates/participation/pool_detail.html:76
#: participation/templates/participation/pool_form.html:11 #: participation/templates/participation/pool_form.html:11
msgid "Update pool" msgid "Update pool"
msgstr "Modifier la poule" msgstr "Modifier la poule"
#: participation/templates/participation/pool_detail.html:83 #: participation/templates/participation/pool_detail.html:86
msgid "Upload notes" msgid "Upload notes"
msgstr "Envoyer les notes" msgstr "Envoyer les notes"
@ -2231,15 +2240,3 @@ msgstr "Résultats"
#: tfjm/templates/search/search.html:25 #: tfjm/templates/search/search.html:25
msgid "No results found." msgid "No results found."
msgstr "Aucun résultat." msgstr "Aucun résultat."
#~ msgid "Two pools are identical. Please relaunch your dices."
#~ msgstr "Deux poules sont identiques. Merci de relancer vos dés."
#~ msgid "last dice"
#~ msgstr "dernier dé"
#~ msgid "Problem"
#~ msgstr "Problème"
#~ msgid "index"
#~ msgstr "position"

View File

@ -170,7 +170,7 @@ class SolutionForm(forms.ModelForm):
class PoolForm(forms.ModelForm): class PoolForm(forms.ModelForm):
class Meta: class Meta:
model = Pool model = Pool
fields = ('tournament', 'round', 'bbb_url', 'results_available', 'juries',) fields = ('tournament', 'round', 'letter', 'bbb_url', 'results_available', 'juries',)
widgets = { widgets = {
"juries": forms.SelectMultiple(attrs={ "juries": forms.SelectMultiple(attrs={
'class': 'selectpicker', 'class': 'selectpicker',

View File

@ -0,0 +1,30 @@
# Generated by Django 4.1.7 on 2023-03-31 15:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("participation", "0003_alter_team_trigram"),
]
operations = [
migrations.AlterModelOptions(
name="pool",
options={
"ordering": ("round", "letter"),
"verbose_name": "pool",
"verbose_name_plural": "pools",
},
),
migrations.AddField(
model_name="pool",
name="letter",
field=models.PositiveSmallIntegerField(
choices=[(1, "A"), (2, "B"), (3, "C"), (4, "D")],
default=1,
verbose_name="letter",
),
preserve_default=False,
),
]

View File

@ -359,6 +359,16 @@ class Pool(models.Model):
] ]
) )
letter = models.PositiveSmallIntegerField(
choices=[
(1, 'A'),
(2, 'B'),
(3, 'C'),
(4, 'D'),
],
verbose_name=_('letter'),
)
participations = models.ManyToManyField( participations = models.ManyToManyField(
Participation, Participation,
related_name="pools", related_name="pools",
@ -406,6 +416,7 @@ class Pool(models.Model):
class Meta: class Meta:
verbose_name = _("pool") verbose_name = _("pool")
verbose_name_plural = _("pools") verbose_name_plural = _("pools")
ordering = ('round', 'letter',)
class Passage(models.Model): class Passage(models.Model):

View File

@ -76,13 +76,20 @@ class TournamentTable(tables.Table):
class PoolTable(tables.Table): class PoolTable(tables.Table):
teams = tables.LinkColumn( letter = tables.LinkColumn(
'participation:pool_detail', 'participation:pool_detail',
args=[tables.A('id')], args=[tables.A('id')],
verbose_name=_("pool").capitalize,
)
teams = tables.Column(
verbose_name=_("teams").capitalize, verbose_name=_("teams").capitalize,
empty_values=(), empty_values=(),
) )
def render_letter(self, record):
return format_lazy(_("Pool {letter}{round}"), letter=record.get_letter_display(), round=record.round)
def render_teams(self, record): def render_teams(self, record):
return ", ".join(participation.team.trigram for participation in record.participations.all()) \ return ", ".join(participation.team.trigram for participation in record.participations.all()) \
or _("No defined team") or _("No defined team")
@ -92,7 +99,7 @@ class PoolTable(tables.Table):
'class': 'table table-condensed table-striped', 'class': 'table table-condensed table-striped',
} }
model = Pool model = Pool
fields = ('teams', 'round', 'tournament',) fields = ('letter', 'teams', 'round', 'tournament',)
class PassageTable(tables.Table): class PassageTable(tables.Table):

View File

@ -15,6 +15,9 @@
<dt class="col-sm-3">{% trans "Round:" %}</dt> <dt class="col-sm-3">{% trans "Round:" %}</dt>
<dd class="col-sm-9">{{ pool.get_round_display }}</dd> <dd class="col-sm-9">{{ pool.get_round_display }}</dd>
<dt class="col-sm-3">{% trans "Letter:" %}</dt>
<dd class="col-sm-9">{{ pool.get_letter_display }}</dd>
<dt class="col-sm-3">{% trans "Teams:" %}</dt> <dt class="col-sm-3">{% trans "Teams:" %}</dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
{% for participation in pool.participations.all %} {% for participation in pool.participations.all %}