Improve PDF presentation
This commit is contained in:
parent
ffcd5fe988
commit
2da76c7081
|
@ -204,7 +204,7 @@ class GymnastReportDocument(PDFDocument):
|
|||
font_decoration="Bold",
|
||||
font_size=14,
|
||||
)
|
||||
# self.add_vspace()
|
||||
|
||||
self.document.setFillColorRGB(0.75, 0.75, 0.75)
|
||||
self.add_new_line(
|
||||
130,
|
||||
|
@ -215,7 +215,6 @@ class GymnastReportDocument(PDFDocument):
|
|||
130,
|
||||
str(gymnast.informations)
|
||||
)
|
||||
# self.add_vspace(HUGE_LINE_HEIGHT)
|
||||
|
||||
def analyse_score(self, value, value_list):
|
||||
""" Analyse une value (value) par rapport à la moyenne de value_list et à la dernière
|
||||
|
@ -309,9 +308,6 @@ class GymnastReportDocument(PDFDocument):
|
|||
"No recorded data.",
|
||||
)
|
||||
|
||||
# last_accident = Accident.objects.filter(gymnast=gymnast).order_by("-date").first()
|
||||
# print(last_accident)
|
||||
|
||||
def add_gymnast_best_scores(self, gymnast):
|
||||
""" Ajoute les meilleurs scores du gymnaste (Tof, compétition, …).
|
||||
|
||||
|
@ -373,9 +369,9 @@ class GymnastReportDocument(PDFDocument):
|
|||
table.drawOn(self.document, X - 6, self.y - height - 5)
|
||||
else:
|
||||
self.add_new_line(
|
||||
X,
|
||||
"No chrono for this gymnast.",
|
||||
)
|
||||
X,
|
||||
"No chrono for this gymnast.",
|
||||
)
|
||||
|
||||
self.y = 20*cm
|
||||
self.add_new_line(
|
||||
|
@ -443,14 +439,9 @@ class GymnastReportDocument(PDFDocument):
|
|||
table.drawOn(self.document, X - 6, self.y - height - 5)
|
||||
else:
|
||||
self.add_new_line(
|
||||
X,
|
||||
"No scores for this gymnast.",
|
||||
)
|
||||
|
||||
|
||||
# routine_1 = gymnast.has_routine.prefetch_related("routine").filter(
|
||||
# date_end__isnull=True
|
||||
# )
|
||||
X,
|
||||
"No scores for this gymnast.",
|
||||
)
|
||||
|
||||
self.add_vspace(HUGE_LINE_HEIGHT)
|
||||
|
||||
|
@ -483,9 +474,14 @@ class GymnastReportDocument(PDFDocument):
|
|||
table.drawOn(self.document, 13.5*cm, self.y - height - 5)
|
||||
else:
|
||||
self.add_new_line(
|
||||
14.5*cm,
|
||||
"No compulsary routine defined."
|
||||
)
|
||||
14*cm,
|
||||
"No compulsary"
|
||||
)
|
||||
self.add_new_line(
|
||||
14*cm,
|
||||
"routine defined."
|
||||
)
|
||||
self.add_vspace(-DOUBLE_LINE_HEIGHT)
|
||||
|
||||
|
||||
routine_2 = gymnast.has_routine.filter(routine_type=2).filter(date_begin__lte=date.today()).filter(Q(date_end__gte=date.today()) | Q(date_end__isnull=True)).first()
|
||||
|
@ -508,9 +504,13 @@ class GymnastReportDocument(PDFDocument):
|
|||
table.drawOn(self.document, 17*cm, self.y - height - 5)
|
||||
else:
|
||||
self.add_new_line(
|
||||
14.5*cm,
|
||||
"No volontary routine defined."
|
||||
)
|
||||
17*cm,
|
||||
"No volontary"
|
||||
)
|
||||
self.add_new_line(
|
||||
17*cm,
|
||||
"routine defined."
|
||||
)
|
||||
|
||||
def add_gymnast_next_skills(self, gymnast):
|
||||
""" Ajoute les prochains skill (skill planifié) à apprendre
|
||||
|
|
Loading…
Reference in New Issue