Changeset 10571


Ignore:
Timestamp:
31 Aug 2013, 14:54:52 (11 years ago)
Author:
Henrik Bettermann
Message:

Pass through landscape parameter to sig_table function and render set table and space widths accordingly.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

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

    r10534 r10571  
    736736            self.context.__parent__, applicantview, note=self.note)
    737737
    738 class ExportPDFPage(UtilityView, grok.View):
     738class ExportPDFPageApplicationSlip(UtilityView, grok.View):
    739739    """Deliver a PDF slip of the context.
    740740    """
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py

    r10565 r10571  
    326326
    327327def sig_table(signatures, lang='en', max_per_row=3, horizontal=None,
    328               single_table=False, start_row=0):
    329     space_width = 0.4  # width in cm of space between signatures
    330     table_width = 16.0 # supposed width of signature table in cms
     328              single_table=False, start_row=0, landscape=False):
     329    if landscape:
     330        space_width = 2.4  # width in cm of space between signatures
     331        table_width = 24.0 # supposed width of signature table in cms
     332    else:
     333        space_width = 0.4  # width in cm of space between signatures
     334        table_width = 16.0 # supposed width of signature table in cms
    331335    # width of signature cells in cm...
    332336    sig_num = len(signatures)
     
    349353            result.append(
    350354                sig_table(row_sigs, lang=lang, max_per_row=max_per_row,
    351                           horizontal=horizontal, start_row=curr_row)[0])
     355                          horizontal=horizontal, start_row=curr_row,
     356                          landscape=landscape)[0],
     357                          )
    352358        missing_num = len(result[-2][0][0]) - len(result[-1][0][0])
    353359        if missing_num:
     
    379385
    380386def get_sig_tables(signatures, lang='en', max_per_row=3, horizontal=None,
    381                    single_table=False):
     387                   single_table=False, landscape=False):
    382388    rows = sig_table(signatures, lang=lang, max_per_row=max_per_row,
    383                      horizontal=horizontal, single_table=single_table)
     389                     horizontal=horizontal, single_table=single_table,
     390                     landscape=landscape)
    384391    if single_table:
    385392        result_data = []
     
    393400
    394401def get_signature_tables(signatures, lang='en', max_per_row=3,
    395                          horizontal=None, single_table=False):
     402                         horizontal=None, single_table=False,
     403                         landscape=False):
    396404    """Get a list of reportlab flowables representing signature fields.
    397405
     
    452460    data_list = get_sig_tables(
    453461        signatures, lang=lang, max_per_row=max_per_row,
    454         horizontal=horizontal, single_table=single_table)
     462        horizontal=horizontal, single_table=single_table, landscape=landscape)
    455463    return [Table(row_data, style=row_style, colWidths=row_col_widths,
    456464                  repeatRows=4)
Note: See TracChangeset for help on using the changeset viewer.