Changeset 15502


Ignore:
Timestamp:
19 Jul 2019, 05:58:55 (5 years ago)
Author:
Henrik Bettermann
Message:

Add passport picture switch to applicants containers.

Location:
main/waeup.kofa/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r15476 r15502  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Add passport picture switch to applicants containers.
    68
    79* Use decimal.Decimal to counteract Python floating point limitation.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r15122 r15502  
    11711171
    11721172    def dataNotComplete(self):
    1173         store = getUtility(IExtFileStore)
    1174         if not store.getFileByContext(self.context, attr=u'passport.jpg'):
    1175             return _('No passport picture uploaded.')
    1176         if not self.request.form.get('confirm_passport', False):
    1177             return _('Passport picture confirmation box not ticked.')
     1173        if self.context.__parent__.with_picture:
     1174            store = getUtility(IExtFileStore)
     1175            if not store.getFileByContext(self.context, attr=u'passport.jpg'):
     1176                return _('No passport picture uploaded.')
     1177            if not self.request.form.get('confirm_passport', False):
     1178                return _('Passport picture confirmation box not ticked.')
    11781179        return False
    11791180
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantdisplaypage.pt

    r15130 r15502  
    1515</div>
    1616
    17 <img src="" height="180px" tal:attributes="src view/passport_url" />
     17<img tal:condition="python: context.__parent__.with_picture"
     18     src="" height="180px" tal:attributes="src view/passport_url" />
    1819
    1920<table i18n:domain="waeup.kofa" class="form-table">
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt

    r15130 r15502  
    2222    <tbody>
    2323      <tal:widgets content="structure provider:widgets" />
    24       <tr>
     24      <tr tal:condition="python: context.__parent__.with_picture">
    2525        <td class="fieldname" i18n:translate="">
    2626          Passport Photo:
     
    6969  </table>
    7070
    71   <div tal:condition="not: view/manage_applications">
     71  <div tal:condition="python: not view.manage_applications
     72                              and context.__parent__.with_picture">
    7273    <input id="confirm_passport" name="confirm_passport"
    7374           type="checkbox" value="True"/>&nbsp;&nbsp;
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r15188 r15502  
    290290        )
    291291
     292    with_picture= schema.Bool(
     293        title = _(u'With passport picture'),
     294        required = False,
     295        default = True,
     296        )
     297
    292298    def addApplicant(applicant):
    293299        """Add an applicant.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r13968 r15502  
    7272        self.assertEqual(
    7373            result,
    74             'application_category,application_fee,application_slip_notice,code,description,'
    75             'enddate,hidden,mode,prefix,startdate,strict_deadline,title,year\r\n'
     74            'application_category,application_fee,application_slip_notice,code,'
     75            'description,enddate,hidden,mode,prefix,startdate,'
     76            'strict_deadline,title,with_picture,year\r\n'
    7677
    7778            'basic,0.0,,dp2015,'
    7879            '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",'
    7980            '2015-01-31 23:00:00+00:00#,0,,app,2015-01-01 12:00:00+00:00#,1,'
    80             'General Studies,2015\r\n'
     81            'General Studies,1,2015\r\n'
    8182            )
    8283        return
Note: See TracChangeset for help on using the changeset viewer.