Ignore:
Timestamp:
3 Apr 2016, 19:14:07 (8 years ago)
Author:
Henrik Bettermann
Message:

Add application type and customize pages for ICT Week Registration application.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/applicants
Files:
2 edited

Legend:

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

    r13615 r13796  
    3737    NigeriaApplicantDisplayFormPage,
    3838    NigeriaApplicantManageFormPage,
     39    NigeriaApplicantEditFormPage,
    3940    NigeriaPDFApplicationSlip)
    4041from waeup.uniben.applicants.interfaces import (
     
    5960
    6061PASTQ_MSS = ['ACC','BNK','BUS','ECO','GEO','POL','SAA','SWK'] + PASTQ_ALL
     62
     63ICT_WEEK_FIELDS = (
     64    'course1',
     65    'course2',
     66    'aggregate',
     67    'screening_score',
     68    'screening_venue',
     69    'screening_date',
     70    'jamb_subjects',
     71    'jamb_score',
     72    'jamb_reg_number',
     73    'hq_type',
     74    'hq_matric_no',
     75    'hq_degree',
     76    'hq_school',
     77    'hq_session',
     78    'hq_disc',
     79    'student_id',
     80    'course_admitted',
     81    )
    6182
    6283class CustomApplicantsContainerPage(ApplicantsContainerPage):
     
    124145    def form_fields(self):
    125146        form_fields = super(CustomApplicantDisplayFormPage, self).form_fields
     147        if self.target == 'ictwk':
     148            for field in ICT_WEEK_FIELDS:
     149                form_fields = form_fields.omit(field)
     150            return form_fields
    126151        if not self.context.admchecking_fee_paid():
    127152            form_fields = form_fields.omit(
     
    229254        if not checkPermission('waeup.uploadPassportPictures', self.context):
    230255            return _('You are not entitled to upload passport pictures.')
     256
     257    @property
     258    def form_fields(self):
     259        form_fields = super(CustomApplicantManageFormPage, self).form_fields
     260        if self.target == 'ictwk':
     261            for field in ICT_WEEK_FIELDS:
     262                form_fields = form_fields.omit(field)
     263        return form_fields
     264
     265
     266class CustomApplicantEditFormPage(NigeriaApplicantEditFormPage):
     267    """An applicant-centered edit view for applicant data.
     268    """
     269
     270    @property
     271    def form_fields(self):
     272        form_fields = super(CustomApplicantEditFormPage, self).form_fields
     273        if self.target == 'ictwk':
     274            for field in ICT_WEEK_FIELDS:
     275                form_fields = form_fields.omit(field)
     276        return form_fields
    231277
    232278class CustomOnlinePaymentApprovePage(OnlinePaymentApprovePage):
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py

    r13615 r13796  
    5151        'afas': ['Asaba Programmes', 'ASA'],
    5252        'afak': ['Akoka Programmes', 'AKO'],
     53        'ictwk': ['ICT Week Registration', 'ICT'],
    5354        }
    5455
Note: See TracChangeset for help on using the changeset viewer.