Changeset 8046 for main/waeup.kofa/trunk


Ignore:
Timestamp:
5 Apr 2012, 11:28:20 (13 years ago)
Author:
Henrik Bettermann
Message:

Define SEPARATORS_DICT in ApplicantsUtils?.

Insert headlines (separators) between groups of widgets also in pdf slips.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
3 edited

Legend:

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

    r8045 r8046  
    6060grok.context(IKofaObject) # Make IKofaObject the default context
    6161
    62 SEPARATORS = {}
    63 SEPARATORS['form.course1'] = _(u'Desired Courses')
    64 SEPARATORS['form.screening_score'] = _(u'Process Data')
    65 
    6662class ApplicantsRootPage(KofaPage):
    6763    grok.context(IApplicantsRoot)
     
    389385    label = _('Applicant')
    390386    pnav = 3
    391     separators = SEPARATORS
     387
     388    @property
     389    def separators(self):
     390        return getUtility(IApplicantsUtils).SEPARATORS_DICT
    392391
    393392    def update(self):
     
    630629    display_actions = [[_('Save'), _('Final Submit')],
    631630        [_('Add online payment ticket'),_('Remove selected tickets')]]
    632     separators = SEPARATORS
     631
     632    @property
     633    def separators(self):
     634        return getUtility(IApplicantsUtils).SEPARATORS_DICT
    633635
    634636    def update(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py

    r8013 r8046  
    2121import grok
    2222from datetime import datetime
    23 from zope.component import getUtility
    24 from zope.i18n import translate
    2523from reportlab.pdfgen import canvas
    2624from reportlab.lib.units import cm
     
    2927from reportlab.platypus import Frame, Paragraph, Image, Table, Spacer
    3028from reportlab.platypus.tables import TableStyle
     29from zope.i18n import translate
    3130from zope.component import getUtility
    3231from zope.formlib.form import setUpEditWidgets
    3332from zope.publisher.browser import TestRequest
    3433from waeup.kofa.widgets.datewidget import FriendlyDateDisplayWidget
    35 from waeup.kofa.applicants.interfaces import IApplicant
     34from waeup.kofa.applicants.interfaces import IApplicant, IApplicantsUtils
    3635from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH
    3736from waeup.kofa.interfaces import IExtFileStore, IPDF, IKofaUtils
     
    175174        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    176175        for widget in widgets: # self.widgets:
     176            separators = getUtility(IApplicantsUtils).SEPARATORS_DICT
     177            if separators and separators.get(widget.name):
     178                f_headline = ('<font size=12><strong>%s</strong></font>'
     179                    % translate(separators[widget.name], 'waeup.kofa',
     180                    target_language=portal_language))
     181                f_headline = Paragraph(f_headline, style["Normal"])
     182                data.append([f_headline ])
    177183            f_label = '<font size=12>%s</font>:' % translate(
    178184                widget.label.strip(), 'waeup.kofa',
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r7844 r8046  
    2121import grok
    2222from waeup.kofa.applicants.interfaces import IApplicantsUtils
     23from waeup.kofa.interfaces import MessageFactory as _
    2324
    2425class ApplicantsUtils(grok.GlobalUtility):
     
    3031      'app': ['General Studies', 'APP'],
    3132      }
     33
     34    SEPARATORS_DICT = {
     35      'form.course1': _(u'Desired Study Courses'),
     36      'form.screening_score': _(u'Process Data'),
     37      }
Note: See TracChangeset for help on using the changeset viewer.