1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 07:02:22 +00:00

Fix total score in tfjm.org export for 5-teams pools

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-05-19 21:09:34 +02:00
parent 70050827d8
commit a43dc9c12a
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -52,11 +52,11 @@ class Command(BaseCommand):
self.w("<table>") self.w("<table>")
self.w("<thead>") self.w("<thead>")
self.w("<tr>") self.w("<tr>")
self.w("\t<th>Équipe</th>") self.w(" <th>Équipe</th>")
self.w("\t<th>Score Tour 1</th>") self.w(" <th>Score Tour 1</th>")
self.w("\t<th>Score Tour 2</th>") self.w(" <th>Score Tour 2</th>")
self.w("\t<th>Total</th>") self.w(" <th>Total</th>")
self.w("\t<th class=\"has-text-align-center\">Prix</th>") self.w(" <th class=\"has-text-align-center\">Prix</th>")
self.w("</tr>") self.w("</tr>")
self.w("</thead>") self.w("</thead>")
self.w("<tbody>") self.w("<tbody>")
@ -64,15 +64,16 @@ class Command(BaseCommand):
self.w("<tr>") self.w("<tr>")
bold = (not tournament.final and participation.final) or (tournament.final and i < 2) bold = (not tournament.final and participation.final) or (tournament.final and i < 2)
if bold: if bold:
prefix, suffix = "\t<td><strong>", "</strong></td>" prefix, suffix = " <td><strong>", "</strong></td>"
else: else:
prefix, suffix = "\t<td>", "</td>" prefix, suffix = " <td>", "</td>"
self.w(f"{participation.team.name} ({participation.team.trigram})", prefix, suffix) self.w(f"{participation.team.name} ({participation.team.trigram})", prefix, suffix)
for pool in tournament.pools.filter(participations=participation).all(): for tournament_round in [1, 2]:
pool_note = pool.average(participation) pool_note = sum(pool.average(participation)
for pool in tournament.pools.filter(participations=participation,
round=tournament_round).all())
self.w(f"{pool_note:.01f}", prefix, suffix) self.w(f"{pool_note:.01f}", prefix, suffix)
self.w(f"{note:.01f}", prefix, suffix) self.w(f"{note:.01f}", prefix, suffix)
if tournament.final:
self.w(participation.mention_final if tournament.final else participation.mention, prefix, suffix) self.w(participation.mention_final if tournament.final else participation.mention, prefix, suffix)
self.w("</tr>") self.w("</tr>")
self.w("</tbody>") self.w("</tbody>")