mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-23 06:36:35 +02:00
Add letter in pool display
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -76,13 +76,20 @@ class TournamentTable(tables.Table):
|
||||
|
||||
|
||||
class PoolTable(tables.Table):
|
||||
teams = tables.LinkColumn(
|
||||
letter = tables.LinkColumn(
|
||||
'participation:pool_detail',
|
||||
args=[tables.A('id')],
|
||||
verbose_name=_("pool").capitalize,
|
||||
)
|
||||
|
||||
teams = tables.Column(
|
||||
verbose_name=_("teams").capitalize,
|
||||
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):
|
||||
return ", ".join(participation.team.trigram for participation in record.participations.all()) \
|
||||
or _("No defined team")
|
||||
@ -92,7 +99,7 @@ class PoolTable(tables.Table):
|
||||
'class': 'table table-condensed table-striped',
|
||||
}
|
||||
model = Pool
|
||||
fields = ('teams', 'round', 'tournament',)
|
||||
fields = ('letter', 'teams', 'round', 'tournament',)
|
||||
|
||||
|
||||
class PassageTable(tables.Table):
|
||||
|
Reference in New Issue
Block a user