#249 improve assignment PDF
This commit is contained in:
parent
a48c63c132
commit
fe7266097f
@ -334,14 +334,15 @@ class AssignmentPDF(PDFView):
|
|||||||
if preamble:
|
if preamble:
|
||||||
story.append(Paragraph("%s" % preamble.replace('\r\n','<br/>'), stylesheet['Paragraph']))
|
story.append(Paragraph("%s" % preamble.replace('\r\n','<br/>'), stylesheet['Paragraph']))
|
||||||
story.append(Spacer(0,0.75*cm))
|
story.append(Spacer(0,0.75*cm))
|
||||||
if not Assignment.objects.exists(): # No assignments existing
|
assignments = Assignment.objects.order_by('name')
|
||||||
story.append(Paragraph(_("No elections existing."), stylesheet['Heading3']))
|
if not assignments: # No assignments existing
|
||||||
|
story.append(Paragraph(_("No assignments available."), stylesheet['Heading3']))
|
||||||
else: # Print all assignments
|
else: # Print all assignments
|
||||||
# List of assignments
|
# List of assignments
|
||||||
for assignment in Assignment.objects.order_by('name'):
|
for assignment in assignments:
|
||||||
story.append(Paragraph(assignment.name, stylesheet['Heading3']))
|
story.append(Paragraph(assignment.name, stylesheet['Heading3']))
|
||||||
# Assignment details (each assignment on single page)
|
# Assignment details (each assignment on single page)
|
||||||
for assignment in Assignment.objects.order_by('name'):
|
for assignment in assignments:
|
||||||
story.append(PageBreak())
|
story.append(PageBreak())
|
||||||
story = self.get_assignment(assignment, story)
|
story = self.get_assignment(assignment, story)
|
||||||
else: # print selected assignment
|
else: # print selected assignment
|
||||||
|
Loading…
Reference in New Issue
Block a user