Changeset 6254 for main


Ignore:
Timestamp:
31 May 2011, 07:12:39 (14 years ago)
Author:
Henrik Bettermann
Message:

Render Admitted Course of Study seperately and provide URL to certificate.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
1 added
2 edited

Legend:

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

    r6198 r6254  
    4444    )
    4545from waeup.sirp.interfaces import IWAeUPObject, ILocalRolesAssignable
     46from waeup.sirp.university.interfaces import ICertificate
    4647from waeup.sirp.widgets.datewidget import (
    4748    FriendlyDateWidget, FriendlyDateDisplayWidget)
     
    435436    grok.name('index')
    436437    grok.require('waeup.handleApplication')
    437     form_fields = grok.AutoFields(IApplicant).omit('locked')
     438    form_fields = grok.AutoFields(IApplicant).omit('locked').omit('course_admitted')
    438439    #form_fields['fst_sit_results'].custom_widget = list_results_display_widget
    439440    form_fields['passport'].custom_widget = ThumbnailWidget
    440441    form_fields['date_of_birth'].custom_widget = FriendlyDateDisplayWidget('le')
    441442    label = 'Applicant'
     443    grok.template('form_display')
    442444    pnav = 3
    443445
     
    450452        container_title = self.context.__parent__.title
    451453        return '%s Application Record' % container_title
     454
     455    @property
     456    def getCourseAdmitted(self):
     457        course_admitted = self.context.course_admitted
     458        #import pdb; pdb.set_trace()
     459        if ICertificate.providedBy(course_admitted):
     460            url = self.url(course_admitted)
     461            title = course_admitted.title
     462            code = course_admitted.code
     463            return '<a href="%s">%s (%s)</a>' %(url,title,code)
     464        return 'not yet admitted'
    452465
    453466class ApplicantsManageActionButton(ManageActionButton):
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py

    r6249 r6254  
    389389        source = lgas_vocab,
    390390        title = u'State/LGA',
    391         required = False,
     391        default = 'foreigner',
     392        required = True,
    392393        )
    393394    sex = schema.Choice(
     
    439440        )
    440441    course_admitted = schema.Choice(
    441         # XXX: should be choice
    442442        title = u'Admitted Course of Study',
    443443        source = CertificateSource(),
     444        default = None,
    444445        required = False,
    445446        )
     
    489490        required = False,
    490491        readonly = True,
     492        default = None,
    491493        )
    492494    entry_session = schema.TextLine(
Note: See TracChangeset for help on using the changeset viewer.