From 1a4a748e6cedff2dadbb77991ca45290c98adeb9 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Fri, 27 Apr 2012 22:47:41 +0200 Subject: [PATCH] #112: Use monotype for printing first time password --- openslides/participant/views.py | 10 +++++----- openslides/utils/pdf.py | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/openslides/participant/views.py b/openslides/participant/views.py index 29208c42e..bf48fc61e 100644 --- a/openslides/participant/views.py +++ b/openslides/participant/views.py @@ -531,7 +531,7 @@ class ParticipantsPasswordsPDF(PDFView): permission_required = 'participant.can_manage_participant' filename = _("Participant-passwords") top_space = 0 - + def append_to_pdf(self, story): #doc = SimpleDocTemplate(response, pagesize=A4, topMargin=-6, bottomMargin=-6, leftMargin=0, rightMargin=0, showBoundary=False) #story = [Spacer(0,0*cm)] @@ -546,8 +546,8 @@ class ParticipantsPasswordsPDF(PDFView): cell.append(Paragraph(_("Your Account for OpenSlides"), stylesheet['Ballot_title'])) cell.append(Paragraph(_("for %s") % (user.profile), stylesheet['Ballot_subtitle'])) cell.append(Spacer(0,0.5*cm)) - cell.append(Paragraph(_("User: %s") % (user.username), stylesheet['Ballot_option'])) - cell.append(Paragraph(_("Password: %s") % (user.profile.firstpassword), stylesheet['Ballot_option'])) + cell.append(Paragraph(_("User: %s") % (user.username), stylesheet['Monotype'])) + cell.append(Paragraph(_("Password: %s") % (user.profile.firstpassword), stylesheet['Monotype'])) cell.append(Spacer(0,0.5*cm)) cell.append(Paragraph(_("URL: %s") % (participant_pdf_system_url), stylesheet['Ballot_option'])) cell.append(Spacer(0,0.5*cm)) @@ -555,11 +555,11 @@ class ParticipantsPasswordsPDF(PDFView): cell2.append(Spacer(0,0.8*cm)) if participant_pdf_welcometext is not None: cell2.append(Paragraph(participant_pdf_welcometext.replace('\r\n','
'), stylesheet['Ballot_subtitle'])) - + data.append([cell,cell2]) except Profile.DoesNotExist: pass - + t=Table(data, 10.5*cm, 7.42*cm) t.setStyle(TableStyle([ ('LINEBELOW', (0,0), (-1,0), 0.25, colors.grey), ('LINEBELOW', (0,1), (-1,1), 0.25, colors.grey), diff --git a/openslides/utils/pdf.py b/openslides/utils/pdf.py index 4d4b7001e..82efc93df 100755 --- a/openslides/utils/pdf.py +++ b/openslides/utils/pdf.py @@ -149,6 +149,13 @@ stylesheet.add(ParagraphStyle(name = 'Ballot_option', leading = 24, leftIndent = 30), ) +stylesheet.add(ParagraphStyle(name = 'Monotype', + parent = stylesheet['Normal'], + fontName = 'Courier', + fontSize = 12, + leading = 24, + leftIndent = 30), + ) stylesheet.add(ParagraphStyle(name = 'Ballot_option_name', parent = stylesheet['Normal'], fontSize = 12,