Changeset 15793 for main


Ignore:
Timestamp:
10 Nov 2019, 21:17:13 (5 years ago)
Author:
Henrik Bettermann
Message:

First application form customizations.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants
Files:
2 edited

Legend:

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

    r15563 r15793  
    2424    NigeriaApplicantDisplayFormPage,
    2525    NigeriaPDFApplicationSlip)
     26from kofacustom.iuokada.applicants.interfaces import ICustomApplicant
    2627
    2728from kofacustom.iuokada.interfaces import MessageFactory as _
    2829
     30class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
     31    """A display view for applicant data.
     32    """
     33    @property
     34    def form_fields(self):
     35        if self.context.special:
     36            form_fields = grok.AutoFields(ISpecialApplicant).omit('locked')
     37        else:
     38            form_fields = grok.AutoFields(ICustomApplicant).omit(
     39                'locked', 'course_admitted', 'password', 'suspended')
     40        return form_fields
     41
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/interfaces.py

    r15563 r15793  
    4040from kofacustom.iuokada.payments.interfaces import ICustomOnlinePayment
    4141
     42sponsors_vocab = SimpleKofaVocabulary(
     43    (_('Bauchi Government'), 'bauchi'),
     44    (_('Company'), 'company'),
     45    (_('Federal Government (Amnesty)'), 'federalgov'),
     46    (_('Dangote Group'), 'dangote'),
     47    (_('Kano Government'), 'kano'),
     48    (_('Parent/Guardian'), 'parent'),
     49    (_('Rosula Organization'), 'rosula'),
     50    (_('Self'), 'self'),
     51    (_('Social Impact Project'), 'social'),
     52    )
     53
     54heard_about_types_vocab = SimpleKofaVocabulary(
     55    (_('Facebook/Twitter/Other Social Media'), 'socmedia'),
     56    (_('From a Friend'), 'friend'),
     57    (_('Newspaper Advertisement'), 'newspaper'),
     58    (_('Radio Advertisement'), 'radio'),
     59    (_('Television Advertisement'), 'television'),
     60    )
     61
    4262class ICustomUGApplicant(INigeriaUGApplicant):
    4363    """An undergraduate applicant.
     
    4767    adding them to the UG_OMIT* tuples.
    4868    """
     69
     70    sponsor = schema.Choice(
     71        title = _(u'Sponsor'),
     72        vocabulary = sponsors_vocab,
     73        required = False,
     74        )
     75
     76    heard_about = schema.Choice(
     77        title = _(u'How did you hear about IU?'),
     78        vocabulary = heard_about_types_vocab,
     79        required = False,
     80        )
    4981
    5082class ICustomPGApplicant(INigeriaPGApplicant):
Note: See TracChangeset for help on using the changeset viewer.