Changeset 15809 for main


Ignore:
Timestamp:
15 Nov 2019, 07:28:55 (5 years ago)
Author:
Henrik Bettermann
Message:

Add application category, hide application fee and show sponsor field.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py

    r15807 r15809  
    2222from waeup.kofa.applicants.browser import (
    2323    ApplicantRegistrationPage, ApplicantsContainerPage)
    24 from waeup.kofa.applicants.interfaces import ISpecialApplicant
     24from waeup.kofa.applicants.interfaces import (
     25    ISpecialApplicant, IApplicantsContainer)
    2526from kofacustom.nigeria.applicants.browser import (
    2627    NigeriaApplicantDisplayFormPage,
     
    2829    NigeriaApplicantEditFormPage,
    2930    NigeriaPDFApplicationSlip)
     31from waeup.kofa.widgets.datewidget import (
     32    FriendlyDateDisplayWidget,
     33    FriendlyDatetimeDisplayWidget)
    3034from kofacustom.nigeria.applicants.interfaces import (
    3135    UG_OMIT_DISPLAY_FIELDS,
     
    4448    )
    4549from kofacustom.iuokada.interfaces import MessageFactory as _
     50
     51class CustomApplicantsContainerPage(ApplicantsContainerPage):
     52    """The standard view for regular applicant containers.
     53    """
     54
     55    @property
     56    def form_fields(self):
     57        form_fields = grok.AutoFields(IApplicantsContainer).omit(
     58            'title', 'description')
     59        form_fields[
     60            'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     61        form_fields[
     62            'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     63        if self.request.principal.id == 'zope.anybody':
     64            form_fields = form_fields.omit(
     65                'code', 'prefix', 'year', 'mode', 'hidden',
     66                'strict_deadline', 'application_category',
     67                'application_slip_notice', 'application_fee', 'with_picture')
     68        return form_fields
    4669
    4770class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/interfaces.py

    r15807 r15809  
    9898    """
    9999
     100    sponsor = schema.Choice(
     101        title = _(u'Sponsor'),
     102        vocabulary = sponsors_vocab,
     103        required = False,
     104        )
     105
     106    heard_about = schema.Choice(
     107        title = _(u'How did you hear about IU?'),
     108        vocabulary = heard_about_types_vocab,
     109        required = False,
     110        )
     111
     112ICustomPGApplicant[
     113    'sponsor'].order =  ICustomPGApplicant['lga'].order
     114ICustomPGApplicant[
     115    'heard_about'].order =  ICustomPGApplicant['lga'].order
     116ICustomPGApplicant[
     117    'sponsor'].order =  ICustomPGApplicant['lga'].order
     118ICustomPGApplicant[
     119    'lga'].order =  ICustomPGApplicant['nationality'].order
    100120
    101121class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py

    r15789 r15809  
    149149        'pg': 'Postgraduate',
    150150        'pre': 'Pre-Degree Studies',
     151        'pt': 'Part-Time Degree Programmes',
    151152        }
Note: See TracChangeset for help on using the changeset viewer.