mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 05:02:14 +01:00 
			
		
		
		
	Better bold lines in tfjm.org export
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
		@@ -17,8 +17,8 @@ class Command(BaseCommand):
 | 
				
			|||||||
            self.w("")
 | 
					            self.w("")
 | 
				
			||||||
            self.w("")
 | 
					            self.w("")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def w(self, msg):
 | 
					    def w(self, msg, prefix="", suffix=""):
 | 
				
			||||||
        self.stdout.write(msg)
 | 
					        self.stdout.write(f"{prefix}{msg}{suffix}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def handle_tournament(self, tournament):
 | 
					    def handle_tournament(self, tournament):
 | 
				
			||||||
        name = tournament.name
 | 
					        name = tournament.name
 | 
				
			||||||
@@ -64,17 +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:
 | 
				
			||||||
                self.w(f"\t<th>{participation.team.name} ({participation.team.trigram})</th>")
 | 
					                prefix, suffix = "\t<td><strong>", "</strong></td>"
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                self.w(f"\t<td>{participation.team.name} ({participation.team.trigram})</td>")
 | 
					                prefix, suffix = "\t<td>", "</td>"
 | 
				
			||||||
 | 
					            self.w(f"{participation.team.name} ({participation.team.trigram})", prefix, suffix)
 | 
				
			||||||
            for pool in tournament.pools.filter(participations=participation).all():
 | 
					            for pool in tournament.pools.filter(participations=participation).all():
 | 
				
			||||||
                pool_note = pool.average(participation)
 | 
					                pool_note = pool.average(participation)
 | 
				
			||||||
                self.w(f"\t<td>{pool_note:.01f}</td>")
 | 
					                self.w(f"{pool_note:.01f}", prefix, suffix)
 | 
				
			||||||
            self.w(f"\t<td>{note:.01f}</td>")
 | 
					            self.w(f"{note:.01f}", prefix, suffix)
 | 
				
			||||||
            if tournament.final:
 | 
					            if tournament.final:
 | 
				
			||||||
                self.w(f"\t<td>{participation.mention_final}</td>")
 | 
					                self.w(participation.mention_final if tournament.final else participation.mention, prefix, suffix)
 | 
				
			||||||
            else:
 | 
					 | 
				
			||||||
                self.w(f"\t<td>{participation.mention}</td>")
 | 
					 | 
				
			||||||
            self.w("</tr>")
 | 
					            self.w("</tr>")
 | 
				
			||||||
        self.w("</tbody>")
 | 
					        self.w("</tbody>")
 | 
				
			||||||
        self.w("</table>")
 | 
					        self.w("</table>")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user