some fixes to pdf.py

This commit is contained in:
Oskar Hahn 2012-02-21 13:32:39 +01:00
parent e9299625ae
commit 281450341d
2 changed files with 13 additions and 23 deletions

View File

@ -176,23 +176,15 @@ stylesheet.add(ParagraphStyle(name = 'Ballot_option_group_right',
leftIndent = 49),
)
# set event information
event_name = config["event_name"]
event_description = config["event_description"]
event_date = config["event_date"]
event_location = config["event_location"]
event_organizer = config["event_organizer"]
def firstPage(canvas, doc):
canvas.saveState()
# page header (with event information)
canvas.setFont('Ubuntu', 10)
canvas.setFillGray(0.4)
canvas.drawString(2.75*cm, 28*cm, "%s | %s" % (event_name, event_description))
if event_date and event_location:
canvas.drawString(2.75*cm, 27.6*cm, "%s, %s" % (event_date, event_location))
canvas.drawString(2.75*cm, 28*cm, "%s | %s" % (config["event_name"], config["event_description"]))
if config["event_date"] and config["event_location"]:
canvas.drawString(2.75 * cm, 27.6 * cm, "%s, %s" % (config["event_date"], config["event_location"]))
# time
canvas.setFont('Ubuntu', 7)
time = datetime.now().strftime(str(_("%Y-%m-%d %H:%Mh")))
@ -216,7 +208,7 @@ def laterPages(canvas, doc):
canvas.setFont('Ubuntu', 7)
canvas.setFillGray(0.4)
canvas.drawString(10 * cm, 1 * cm, _("Page") + " %s" % doc.page)
canvas.restoreState()s
canvas.restoreState()
@permission_required('participant.can_see_participant')

View File

@ -105,8 +105,6 @@ class DeleteView(RedirectView, SingleObjectMixin):
self.object = self.get_object()
self.confirm_form(request, self.object)
def pre_post_redirect(self, request, *args, **kwargs):
pass
class PDFView(View, PermissionMixin):
filename = 'No_Name'