PDF presentation improvement and minor optimisation

This commit is contained in:
Gregory Trullemans 2022-10-17 11:33:22 +02:00
parent 39cdc9e4a3
commit 6d332c01a4
1 changed files with 7 additions and 6 deletions

View File

@ -197,7 +197,6 @@ class GymnastReportDocument(PDFDocument):
self.add_gymnast_active_routine(gymnast)
# self.add_gymnast_level_information(gymnast)
planned_skill = self.add_gymnast_planned_skill(gymnast)
print(planned_skill)
self.add_gymnast_last_learned_skill(gymnast)
self.add_gymnast_next_events(gymnast)
self.add_gymnast_week_notes(gymnast)
@ -616,7 +615,6 @@ class GymnastReportDocument(PDFDocument):
X,
"No next skill to learn plannified.",
)
print(planned_skills)
return planned_skills
def add_gymnast_next_events(self, gymnast):
@ -705,14 +703,17 @@ class GymnastReportDocument(PDFDocument):
for planned_skill in planned_skills:
plan = Plan.objects.get(pk=planned_skill.plan_id)
# Titre du skill
html_text = "<u>" + planned_skill.short_label + " (" + planned_skill.notation + ") :</u>"
paragraph = Paragraph(html_text, self.style)
width, height = paragraph.wrap(18*cm, 10*cm)
paragraph.drawOn(self.document, INDENTED_X, self.y - (height / 2))
paragraph.drawOn(self.document, INDENTED_X, self.y)
self.add_vspace(- height - 0.5*cm)
html_text = plan.informations
paragraph = Paragraph(html_text, self.style)
# Informations du skill pour le gymnaste
paragraph = Paragraph(plan.informations, self.style)
width, height = paragraph.wrap(18*cm, 10*cm)
paragraph.drawOn(self.document, INDENTED_X, self.y - (height / 2))
paragraph.drawOn(self.document, INDENTED_X, self.y)
self.add_vspace(- height)
self.add_vspace(-0.4*cm)