Changeset 10329


Ignore:
Timestamp:
21 Jun 2013, 07:26:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Render two-column table of widgets behind the regular widgets table.

Add login information to note.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py

    r10319 r10329  
    9595        return [x is not None and x.longtitle() or x for x in dept, faculty]
    9696
    97     def _addComments(self, data):
     97    def _addLoginInformation(self):
    9898        if self.context.state == 'created':
    9999            comment = translate(_(
    100                 'Proceed to the login page of the portal' +
     100                '\n Proceed to the login page of the portal' +
    101101                ' and enter your new credentials:' +
    102102                ' user name= ${a}, password = ${b}. ' +
     
    106106                    'b':self.context.application_number}
    107107                ))
    108             comment = Paragraph(comment, SMALL_PARA_STYLE)
    109             data.extend([Spacer(1, 18), comment])
    110         return data
     108        return comment
    111109
    112110    def _getPDFCreator(self):
     
    150148        data.append(header_table)
    151149
    152         # append two-column table of widgets of those fields defined in
    153         # two_columns_design_fields
    154         fields = [
    155             field for field in self.form_fields
    156                 if not field.__name__ in self.column_two_fields and
    157                 field.__name__ in self.two_columns_design_fields]
    158         if fields:
    159             data.append(creator.getWidgetsTable(
    160                 fields, self.context, view, lang=portal_language,
    161                 domain='waeup.kofa', twoDataCols=True))
    162 
    163150        # append widgets except those already added in column two
     151        # and those in two_columns_design_fields
    164152        dept, faculty = self._getDeptAndFaculty()
    165153        fields = [
     
    174162            dept=dept, faculty=faculty))
    175163
    176         # append comments
    177         data = self._addComments(data)
     164        # append two-column table of widgets of those fields defined in
     165        # two_columns_design_fields
     166        if len(self.two_columns_design_fields):
     167            fields = [
     168                field for field in self.form_fields
     169                    if not field.__name__ in self.column_two_fields and
     170                    field.__name__ in self.two_columns_design_fields]
     171            if fields:
     172                data.append(creator.getWidgetsTable(
     173                    fields, self.context, view, lang=portal_language,
     174                    domain='waeup.kofa', separators=separators,
     175                    twoDataCols=True))
    178176
    179         return creator.create_pdf(data, None, doc_title, note=self.note)
     177        # append login information
     178        note = self.note + self._addLoginInformation()
     179
     180        return creator.create_pdf(data, None, doc_title, note=note)
Note: See TracChangeset for help on using the changeset viewer.