update application pdf
This commit is contained in:
parent
0cf0e58af9
commit
d8136045bb
@ -136,11 +136,11 @@ class Application(models.Model, SlideMixin):
|
|||||||
"""
|
"""
|
||||||
note = []
|
note = []
|
||||||
if self.status == "pub" and not self.enough_supporters:
|
if self.status == "pub" and not self.enough_supporters:
|
||||||
note.append(_("Searching for supporters."))
|
note.append(ugettext("Searching for supporters."))
|
||||||
if self.status == "pub" and self.permitted is None:
|
if self.status == "pub" and self.permitted is None:
|
||||||
note.append(_("Not yet authorized."))
|
note.append(ugettext("Not yet authorized."))
|
||||||
elif self.unpermitted_changes and self.permitted:
|
elif self.unpermitted_changes and self.permitted:
|
||||||
note.append(_("Not yet authorized changes."))
|
note.append(ugettext("Not yet authorized changes."))
|
||||||
return note
|
return note
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -700,6 +700,9 @@ class ApplicationPDF(PDFView):
|
|||||||
story = self.get_application(application, story)
|
story = self.get_application(application, story)
|
||||||
|
|
||||||
def get_application(self, application, story):
|
def get_application(self, application, story):
|
||||||
|
# Preparing Table
|
||||||
|
data = []
|
||||||
|
|
||||||
# application number
|
# application number
|
||||||
if application.number:
|
if application.number:
|
||||||
story.append(Paragraph(_("Motion No.")+" %s" % application.number, stylesheet['Heading1']))
|
story.append(Paragraph(_("Motion No.")+" %s" % application.number, stylesheet['Heading1']))
|
||||||
@ -708,85 +711,81 @@ class ApplicationPDF(PDFView):
|
|||||||
|
|
||||||
# submitter
|
# submitter
|
||||||
cell1a = []
|
cell1a = []
|
||||||
cell1a.append(Spacer(0,0.2*cm))
|
cell1a.append(Spacer(0, 0.2 * cm))
|
||||||
cell1a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Submitter"), stylesheet['Heading4']))
|
cell1a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Submitter"), stylesheet['Heading4']))
|
||||||
cell1b = []
|
cell1b = []
|
||||||
cell1b.append(Spacer(0,0.2*cm))
|
cell1b.append(Spacer(0, 0.2 * cm))
|
||||||
|
cell1b.append(Paragraph("%s" % application.submitter, stylesheet['Normal']))
|
||||||
|
data.append([cell1a, cell1b])
|
||||||
|
|
||||||
if application.status == "pub":
|
if application.status == "pub":
|
||||||
cell1b.append(Paragraph("__________________________________________",stylesheet['Signaturefield']))
|
# Cell for the signature
|
||||||
cell1b.append(Spacer(0,0.1*cm))
|
cell2a = []
|
||||||
cell1b.append(Paragraph(_("Signature: %s") % application.submitter, stylesheet['Small']))
|
cell2b = []
|
||||||
cell1b.append(Spacer(0,0.2*cm))
|
cell2a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Signature"), stylesheet['Heading4']))
|
||||||
else:
|
cell2b.append(Paragraph("__________________________________________", stylesheet['Signaturefield']))
|
||||||
cell1b.append(Paragraph(unicode(application.submitter), stylesheet['Normal']))
|
cell2b.append(Spacer(0, 0.1 * cm))
|
||||||
|
cell2b.append(Spacer(0,0.2*cm))
|
||||||
|
data.append([cell2a, cell2b])
|
||||||
|
|
||||||
# supporters
|
# supporters
|
||||||
cell2a = []
|
|
||||||
cell2b = []
|
|
||||||
if config['application_min_supporters']:
|
if config['application_min_supporters']:
|
||||||
|
cell3a = []
|
||||||
cell2a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font><seqreset id='counter'>" % _("Supporters"), stylesheet['Heading4']))
|
cell3b = []
|
||||||
|
cell3a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font><seqreset id='counter'>" % _("Supporters"), stylesheet['Heading4']))
|
||||||
for supporter in application.supporters:
|
for supporter in application.supporters:
|
||||||
cell2b.append(Paragraph("<seq id='counter'/>. %s" % unicode(supporter), stylesheet['Signaturefield']))
|
cell3b.append(Paragraph("<seq id='counter'/>. %s" % supporter, stylesheet['Signaturefield']))
|
||||||
if application.status == "pub":
|
if application.status == "pub":
|
||||||
for x in range(0,application.missing_supporters):
|
for x in range(application.missing_supporters):
|
||||||
cell2b.append(Paragraph("<seq id='counter'/>. __________________________________________",stylesheet['Signaturefield']))
|
cell3b.append(Paragraph("<seq id='counter'/>. __________________________________________",stylesheet['Signaturefield']))
|
||||||
cell2b.append(Spacer(0,0.2*cm))
|
cell3b.append(Spacer(0, 0.2 * cm))
|
||||||
|
data.append([cell3a, cell3b])
|
||||||
|
|
||||||
# status
|
# status
|
||||||
note = ""
|
cell4a = []
|
||||||
for n in application.notes:
|
cell4b = []
|
||||||
note += "%s " % unicode(n)
|
note = " ".join(application.notes)
|
||||||
cell3a = []
|
cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Status"), stylesheet['Heading4']))
|
||||||
cell3a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Status"), stylesheet['Heading4']))
|
|
||||||
cell3b = []
|
|
||||||
if note != "":
|
if note != "":
|
||||||
if application.status == "pub":
|
if application.status == "pub":
|
||||||
cell3b.append(Paragraph(note, stylesheet['Normal']))
|
cell4b.append(Paragraph(note, stylesheet['Normal']))
|
||||||
else:
|
else:
|
||||||
cell3b.append(Paragraph("%s | %s" % (application.get_status_display(), note), stylesheet['Normal']))
|
cell4b.append(Paragraph("%s | %s" % (application.get_status_display(), note), stylesheet['Normal']))
|
||||||
else:
|
else:
|
||||||
cell3b.append(Paragraph("%s" % application.get_status_display(), stylesheet['Normal']))
|
cell4b.append(Paragraph("%s" % application.get_status_display(), stylesheet['Normal']))
|
||||||
|
data.append([cell4a, cell4b])
|
||||||
# table
|
|
||||||
data = []
|
|
||||||
data.append([cell1a,cell1b])
|
|
||||||
data.append([cell2a,cell2b])
|
|
||||||
data.append([cell3a,cell3b])
|
|
||||||
|
|
||||||
# Version number (aid)
|
# Version number (aid)
|
||||||
if application.public_version.aid > 1:
|
if application.public_version.aid > 1:
|
||||||
cell4a = []
|
cell5a = []
|
||||||
cell4a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Version"), stylesheet['Heading4']))
|
cell5b = []
|
||||||
cell4b = []
|
cell5a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Version"), stylesheet['Heading4']))
|
||||||
cell4b.append(Paragraph("%s" % application.public_version.aid, stylesheet['Normal']))
|
cell5b.append(Paragraph("%s" % application.public_version.aid, stylesheet['Normal']))
|
||||||
data.append([cell4a,cell4b])
|
data.append([cell5a, cell5b])
|
||||||
|
|
||||||
poll_results = application.get_poll_results()
|
|
||||||
|
|
||||||
# voting results
|
# voting results
|
||||||
|
poll_results = application.get_poll_results()
|
||||||
if poll_results:
|
if poll_results:
|
||||||
cell5a = []
|
cell6a = []
|
||||||
cell5a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Vote results"), stylesheet['Heading4']))
|
cell6a.append(Paragraph("<font name='Ubuntu-Bold'>%s:</font>" % _("Vote results"), stylesheet['Heading4']))
|
||||||
cell5b = []
|
cell6b = []
|
||||||
ballotcounter = 0
|
ballotcounter = 0
|
||||||
for result in poll_results:
|
for result in poll_results:
|
||||||
ballotcounter += 1
|
ballotcounter += 1
|
||||||
if len(poll_results) > 1:
|
if len(poll_results) > 1:
|
||||||
cell5b.append(Paragraph("%s. %s" % (ballotcounter, _("Vote")), stylesheet['Bold']))
|
cell6b.append(Paragraph("%s. %s" % (ballotcounter, _("Vote")), stylesheet['Bold']))
|
||||||
cell5b.append(Paragraph("%s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s" % (_("Yes"), result[0], _("No"), result[1], _("Abstention"), result[2], _("Invalid"), result[3], _("Votes cast"), result[4]), stylesheet['Normal']))
|
cell6b.append(Paragraph("%s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s <br/> %s: %s" % (_("Yes"), result[0], _("No"), result[1], _("Abstention"), result[2], _("Invalid"), result[3], _("Votes cast"), result[4]), stylesheet['Normal']))
|
||||||
cell5b.append(Spacer(0,0.2*cm))
|
cell6b.append(Spacer(0, 0.2*cm))
|
||||||
data.append([cell5a,cell5b])
|
data.append([cell6a, cell6b])
|
||||||
|
|
||||||
t=Table(data)
|
# Creating Table
|
||||||
t._argW[0]=4.5*cm
|
t = Table(data)
|
||||||
t._argW[1]=11*cm
|
t._argW[0] = 4.5 * cm
|
||||||
t.setStyle(TableStyle([ ('BOX', (0,0), (-1,-1), 1, colors.black),
|
t._argW[1] = 11 * cm
|
||||||
('VALIGN', (0,0), (-1,-1), 'TOP'),
|
t.setStyle(TableStyle([('BOX', (0, 0), (-1, -1), 1, colors.black),
|
||||||
]))
|
('VALIGN', (0,0), (-1,-1), 'TOP')]))
|
||||||
story.append(t)
|
story.append(t)
|
||||||
story.append(Spacer(0,1*cm))
|
story.append(Spacer(0, 1 * cm))
|
||||||
|
|
||||||
# title
|
# title
|
||||||
story.append(Paragraph(application.public_version.title, stylesheet['Heading3']))
|
story.append(Paragraph(application.public_version.title, stylesheet['Heading3']))
|
||||||
|
Loading…
Reference in New Issue
Block a user