- Timestamp:
- 21 Jun 2013, 07:23:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py
r10319 r10328 623 623 624 624 def _getWidgetsTableData(self, widgets, separators, domain, 625 lang, t able_style, twoDataCols):625 lang, twoDataCols): 626 626 row_num = 0 627 627 table_data = [] 628 628 for widget in widgets: 629 # We do not render headlines in multi-column design 630 if twoDataCols is False and separators and separators.get(widget.name): 629 if separators and separators.get(widget.name): 631 630 f_headline = translate( 632 631 separators[widget.name], domain, target_language=lang) 633 632 f_headline = Paragraph(f_headline, HEADLINE1_STYLE) 634 633 table_data.append([f_headline]) 635 table_style.append(('SPAN', (0,row_num), (-1,row_num)),)636 table_style.append(637 ('TOPPADDING', (0,row_num), (-1,row_num), 12),)638 634 row_num += 1 639 635 f_label = translate(widget.label.strip(), domain, … … 648 644 table_data.append([f_label,f_text]) 649 645 row_num += 1 650 return table_data, row_num , table_style646 return table_data, row_num 651 647 652 648 def getWidgetsTable(self, form_fields, context, view, lang='en', … … 688 684 689 685 # Determine table data 690 table_data, row_num , table_style= self._getWidgetsTableData(691 widgets, separators, domain, lang, t able_style, twoDataCols)686 table_data, row_num = self._getWidgetsTableData( 687 widgets, separators, domain, lang, twoDataCols) 692 688 693 689 # Add course (admitted, etc.) if applicable … … 699 695 table_data, row_num, dept, faculty, lang, domain) 700 696 701 # render two-column table of tables 697 # render two-column table of tables if applicable 702 698 lines = len(table_data) 703 699 middle = lines/2 704 700 if twoDataCols is True and lines > 2: 705 table_left = Table(table_data[:middle +1],706 style=table_style, colWidths=[ 5*cm, 4*cm])707 table_right = Table(table_data[middle +1:],708 style=table_style, colWidths=[ 5*cm, 4*cm])709 table_style.append(('LEFTPADDING', (0,0), (0,-1), 3 *cm),)701 table_left = Table(table_data[:middle], 702 style=table_style, colWidths=[4*cm, 5*cm]) 703 table_right = Table(table_data[middle:], 704 style=table_style, colWidths=[4*cm, 5*cm]) 705 table_style.append(('LEFTPADDING', (0,0), (0,-1), 3.147*cm),) 710 706 table = Table([[table_left, table_right],],style=table_style) 711 707 return table
Note: See TracChangeset for help on using the changeset viewer.