Ignore:
Timestamp:
13 Nov 2014, 13:21:59 (10 years ago)
Author:
Henrik Bettermann
Message:

Enucleation. Keep only the portal's framework. Remove university, students, applicants, hostels and accesscodes modules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/henrik-regista/src/waeup/kofa/browser/pdf.py

    r10595 r11947  
    566566
    567567    @classmethod
    568     def _addCourse(cls, table_data, row_num, course_label, course_link,
    569                    lang, domain):
    570         """Add course data to `table_data`.
    571         """
    572         if not course_label or not course_link:
    573             return table_data, row_num
    574         f_label= translate(
    575             _(course_label), domain, target_language=lang)
    576         f_label = Paragraph(f_label, ENTRY1_STYLE)
    577         f_text = Paragraph(course_link, ENTRY1_STYLE)
    578         table_data.append([f_label, f_text])
    579         row_num += 1
    580         return table_data, row_num
    581 
    582     @classmethod
    583     def _addDeptAndFaculty(cls, table_data, row_num, dept, faculty,
    584                            lang, domain):
    585         """Add `dept` and `faculty` as table rows to `table_data`.
    586 
    587         `dept` and `faculty` are expected to be strings or None. In
    588         latter case they are not put into the table.
    589         """
    590         for label, text in (('Department:', dept), ('Faculty:', faculty)):
    591             if text is None:
    592                 continue
    593             label = translate(_(label), domain, target_language=lang)
    594             table_data.append([
    595                 Paragraph(label, ENTRY1_STYLE),
    596                 Paragraph(text, ENTRY1_STYLE)])
    597             row_num += 1
    598         return table_data, row_num
    599 
    600     @classmethod
    601568    def _drawSignatureBoxes(cls, canvas, width, height, signatures=[]):
    602569        """Draw signature boxes into canvas.
     
    661628    def getWidgetsTable(self, form_fields, context, view, lang='en',
    662629                        domain='waeup.kofa', separators=None,
    663                         course_label=None, course_link=None, dept=None,
    664                         faculty=None, colWidths=None, twoDataCols=False):
     630                        colWidths=None, twoDataCols=False):
    665631        """Return a reportlab `Table` instance, created from widgets
    666632        determined by `form_fields` and `context`.
     
    679645        - `separators`
    680646           a list of separators.
    681         - `course_label` and `course_link`
    682            if a course should be added to the table, `course_label`
    683            and `course_link` can be given, both being strings. They
    684            will be rendered in an extra-row.
    685         - `dept` and `faculty`
    686            if these are given, we render extra rows with faculty and
    687            department.
    688647        - `colWidths`
    689648           defines the the column widths of the data in the right column
     
    699658        table_data, row_num = self._getWidgetsTableData(
    700659            widgets, separators, domain, lang, twoDataCols)
    701 
    702         # Add course (admitted, etc.) if applicable
    703         table_data, row_num = self._addCourse(
    704             table_data, row_num, course_label, course_link, lang, domain,)
    705 
    706         ## Add dept. and faculty if applicable
    707         table_data, row_num = self._addDeptAndFaculty(
    708             table_data, row_num, dept, faculty, lang, domain)
    709660
    710661        # render two-column table of tables if applicable
Note: See TracChangeset for help on using the changeset viewer.