Changeset 10319 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 20 Jun 2013, 19:41:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py
r10318 r10319 622 622 return img 623 623 624 def _getWidgetsTableData(self, widgets, 625 separators, domain, lang, table_style):624 def _getWidgetsTableData(self, widgets, separators, domain, 625 lang, table_style, twoDataCols): 626 626 row_num = 0 627 627 table_data = [] 628 628 for widget in widgets: 629 if separators and separators.get(widget.name): 629 # We do not render headlines in multi-column design 630 if twoDataCols is False and separators and separators.get(widget.name): 630 631 f_headline = translate( 631 632 separators[widget.name], domain, target_language=lang) 632 633 f_headline = Paragraph(f_headline, HEADLINE1_STYLE) 633 table_data.append([f_headline 634 table_data.append([f_headline]) 634 635 table_style.append(('SPAN', (0,row_num), (-1,row_num)),) 635 636 table_style.append( … … 676 677 if these are given, we render extra rows with faculty and 677 678 department. 679 - `colWidths` 680 defines the the column widths of the data in the right column 681 of base data (right to the passport image). 678 682 - `twoDataCols` 679 render widgets in a parent table with two columns. 680 """ 681 table_style = [#('LEFTPADDING', (0,0), (0,-1), 0), # indentation 682 ('VALIGN', (0,0), (-1,-1), 'TOP'), 683 renders data widgets in a parent table with two columns. 684 """ 685 table_style = [('VALIGN', (0,0), (-1,-1), 'TOP'), 683 686 ] 684 687 widgets = self._setUpWidgets(form_fields, context) … … 686 689 # Determine table data 687 690 table_data, row_num, table_style = self._getWidgetsTableData( 688 widgets, separators, domain, lang, table_style )691 widgets, separators, domain, lang, table_style, twoDataCols) 689 692 690 693 # Add course (admitted, etc.) if applicable … … 696 699 table_data, row_num, dept, faculty, lang, domain) 697 700 698 # Create table 701 # render two-column table of tables 702 lines = len(table_data) 703 middle = lines/2 704 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),) 710 table = Table([[table_left, table_right],],style=table_style) 711 return table 712 713 # render single table 699 714 table = Table( 700 715 table_data,style=table_style, colWidths=colWidths) #, rowHeights=14)
Note: See TracChangeset for help on using the changeset viewer.