PDF presentation improvement and minor optimisation
This commit is contained in:
parent
39cdc9e4a3
commit
6d332c01a4
|
@ -197,7 +197,6 @@ class GymnastReportDocument(PDFDocument):
|
||||||
self.add_gymnast_active_routine(gymnast)
|
self.add_gymnast_active_routine(gymnast)
|
||||||
# self.add_gymnast_level_information(gymnast)
|
# self.add_gymnast_level_information(gymnast)
|
||||||
planned_skill = self.add_gymnast_planned_skill(gymnast)
|
planned_skill = self.add_gymnast_planned_skill(gymnast)
|
||||||
print(planned_skill)
|
|
||||||
self.add_gymnast_last_learned_skill(gymnast)
|
self.add_gymnast_last_learned_skill(gymnast)
|
||||||
self.add_gymnast_next_events(gymnast)
|
self.add_gymnast_next_events(gymnast)
|
||||||
self.add_gymnast_week_notes(gymnast)
|
self.add_gymnast_week_notes(gymnast)
|
||||||
|
@ -616,7 +615,6 @@ class GymnastReportDocument(PDFDocument):
|
||||||
X,
|
X,
|
||||||
"No next skill to learn plannified.",
|
"No next skill to learn plannified.",
|
||||||
)
|
)
|
||||||
print(planned_skills)
|
|
||||||
return planned_skills
|
return planned_skills
|
||||||
|
|
||||||
def add_gymnast_next_events(self, gymnast):
|
def add_gymnast_next_events(self, gymnast):
|
||||||
|
@ -705,14 +703,17 @@ class GymnastReportDocument(PDFDocument):
|
||||||
for planned_skill in planned_skills:
|
for planned_skill in planned_skills:
|
||||||
plan = Plan.objects.get(pk=planned_skill.plan_id)
|
plan = Plan.objects.get(pk=planned_skill.plan_id)
|
||||||
|
|
||||||
|
# Titre du skill
|
||||||
html_text = "<u>" + planned_skill.short_label + " (" + planned_skill.notation + ") :</u>"
|
html_text = "<u>" + planned_skill.short_label + " (" + planned_skill.notation + ") :</u>"
|
||||||
paragraph = Paragraph(html_text, self.style)
|
paragraph = Paragraph(html_text, self.style)
|
||||||
width, height = paragraph.wrap(18*cm, 10*cm)
|
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
|
# Informations du skill pour le gymnaste
|
||||||
paragraph = Paragraph(html_text, self.style)
|
paragraph = Paragraph(plan.informations, self.style)
|
||||||
width, height = paragraph.wrap(18*cm, 10*cm)
|
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)
|
self.add_vspace(-0.4*cm)
|
||||||
|
|
Loading…
Reference in New Issue