Changeset 16786 for main


Ignore:
Timestamp:
8 Feb 2022, 21:35:52 (3 years ago)
Author:
Henrik Bettermann
Message:

Customize referee report form.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/applicant.py

    r15991 r16786  
    2222from waeup.kofa.interfaces import IExtFileStore
    2323from waeup.kofa.applicants.applicant import ApplicantFactory
     24from waeup.kofa.applicants.refereereport import (
     25    ApplicantRefereeReport, ApplicantRefereeReportFactory)
    2426from waeup.kofa.utils.helpers import attrs_to_fields
    2527from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
     
    2729    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit,
    2830    IPUTMEApplicantEdit, ITranscriptApplicant, ICertificateRequest,
    29     IFedexRequest, IRecruitment)
     31    IFedexRequest, IRecruitment, ICustomApplicantRefereeReport)
    3032
    3133class CustomApplicant(NigeriaApplicant):
     
    6466    def getInterfaces(self):
    6567        return implementedBy(CustomApplicant)
     68
     69class CustomApplicantRefereeReport(ApplicantRefereeReport):
     70    """This is a custom referee report.
     71    """
     72    grok.implements(ICustomApplicantRefereeReport)
     73    grok.provides(ICustomApplicantRefereeReport)
     74
     75CustomApplicantRefereeReport = attrs_to_fields(CustomApplicantRefereeReport)
     76
     77class CustomApplicantRefereeReportFactory(ApplicantRefereeReportFactory):
     78    """A factory for applicant online payments.
     79    """
     80
     81    def __call__(self, *args, **kw):
     82        return CustomApplicantRefereeReport()
     83
     84    def getInterfaces(self):
     85        return implementedBy(CustomApplicantRefereeReport)
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r16774 r16786  
    3131from waeup.kofa.applicants.browser import (
    3232    ApplicantCheckStatusPage,
    33     AdditionalFile)
     33    AdditionalFile,
     34    RefereeReportAddFormPage,
     35    RefereeReportDisplayFormPage,
     36    ExportPDFReportSlipPage,
     37    ExportPDFReportSlipPage2)
    3438from waeup.kofa.applicants.workflow import STARTED, PAID
    3539from waeup.kofa.applicants.viewlets import PDFActionButton
     
    6266    IRecruitment,
    6367    ICustomApplicantOnlinePayment,
     68    ICustomApplicantRefereeReport,
    6469    )
    6570
     
    781786            self.context, applicantview, note=self.note)
    782787
     788class CustomRefereeReportAddFormPage(RefereeReportAddFormPage):
     789    """Add-form to add an referee report. This form
     790    is protected by a mandate.
     791    """
     792    form_fields = grok.AutoFields(
     793        ICustomApplicantRefereeReport).omit('creation_date')
     794
     795class CustomRefereeReportDisplayFormPage(RefereeReportDisplayFormPage):
     796    """A display view for referee reports.
     797    """
     798    form_fields = grok.AutoFields(ICustomApplicantRefereeReport)
     799    form_fields[
     800        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     801
     802class CustomExportPDFReportSlipPage(ExportPDFReportSlipPage):
     803    form_fields = grok.AutoFields(ICustomApplicantRefereeReport)
     804    form_fields[
     805        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     806
     807class CustomExportPDFReportSlipPage2(ExportPDFReportSlipPage2):
     808    form_fields = grok.AutoFields(ICustomApplicantRefereeReport)
     809    form_fields[
     810        'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     811
    783812class StateResult(AdditionalFile):
    784813    """Renders the pdf form extension for applicants.
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/export.py

    r14304 r16786  
    2121from waeup.kofa.applicants.interfaces import IApplicantBaseData
    2222from waeup.kofa.utils.helpers import iface_names
     23from waeup.kofa.applicants.export import ApplicantRefereeReportExporter
    2324from kofacustom.nigeria.applicants.export import NigeriaApplicantExporter
    2425from kofacustom.nigeria.applicants.interfaces import (
    2526    INigeriaUGApplicant, INigeriaPGApplicant)
    2627from waeup.aaue.applicants.interfaces import (
    27     ICustomUGApplicant, ITranscriptApplicant, ICertificateRequest)
     28    ICustomUGApplicant, ITranscriptApplicant, ICertificateRequest,
     29    ICustomApplicantRefereeReport)
    2830
    2931class CustomApplicantExporter(NigeriaApplicantExporter):
     
    4143        'password', 'state', 'history', 'container_code', 'application_number',
    4244        'display_fullname', 'application_date')
     45
     46class CustomApplicantRefereeReportExporter(ApplicantRefereeReportExporter):
     47
     48    fields = tuple(sorted(iface_names(
     49        ICustomApplicantRefereeReport,
     50        exclude_attribs=False))) + (
     51              'applicant_id',
     52              'reg_number',
     53              'display_fullname',)
     54
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py

    r16763 r16786  
    3333from waeup.kofa.applicants.interfaces import (
    3434    contextual_reg_num_source,
    35     IApplicantBaseData)
     35    IApplicantBaseData,
     36    IApplicantRefereeReport)
    3637from waeup.kofa.refereeentries import RefereeEntryField
    3738from waeup.kofa.university.vocabularies import StudyModeSource
     
    8182    (_('Proficiency in English Language'), 'english'),
    8283    )
     84
     85rating_vocab = SimpleKofaVocabulary(
     86    (_('Excellent'), 'e'),
     87    (_('Very good'), 'vg'),
     88    (_('Good'), 'g'),
     89    (_('Slightly above average'), 'saa'),
     90    (_('Average'), 'a'),
     91    (_('Below average'), 'ba'),
     92    (_('Unable to assess'), 'unable'),
     93    )
     94
     95overallpromise_vocab = SimpleKofaVocabulary(
     96    (_('Very good (highest 10%)'), 'vg'),
     97    (_('Good (next 15%)'), 'g'),
     98    (_('Above average (next 15%)'), 'aa'),
     99    (_('Average (middle 20%)'), 'a'),
     100    (_('Below average (lower 10%)'), 'ba'),
     101    )
     102
    83103
    84104class ICustomUGApplicant(IApplicantBaseData):
     
    16471667        )
    16481668
    1649 
    1650 
    1651 
     1669class ICustomApplicantRefereeReport(IApplicantRefereeReport):
     1670    """A referee report.
     1671    """
     1672
     1673    duration = schema.Text(
     1674        title = _(u'How long and in what capacity have you known the candidate?'),
     1675        required = False,
     1676        )
     1677
     1678    itellectual = schema.Choice(
     1679        title = _(u'Intellectual Capacity'),
     1680        required = False,
     1681        readonly = False,
     1682        vocabulary = rating_vocab,
     1683        )
     1684
     1685    persistent = schema.Choice(
     1686        title = _(u'Capacity for Persistent and Independent Academic Study'),
     1687        required = False,
     1688        readonly = False,
     1689        vocabulary = rating_vocab,
     1690        )
     1691
     1692    imaginative = schema.Choice(
     1693        title = _(u'Ability for Imaginative Thought'),
     1694        required = False,
     1695        readonly = False,
     1696        vocabulary = rating_vocab,
     1697        )
     1698
     1699    productive = schema.Choice(
     1700        title = _(u'Promise of Productive Scholarship'),
     1701        required = False,
     1702        readonly = False,
     1703        vocabulary = rating_vocab,
     1704        )
     1705
     1706    previous = schema.Choice(
     1707        title = _(u'Quality of Previous Work'),
     1708        required = False,
     1709        readonly = False,
     1710        vocabulary = rating_vocab,
     1711        )
     1712
     1713    expression = schema.Choice(
     1714        title = _(u'Oral and Written Expression in English'),
     1715        required = False,
     1716        readonly = False,
     1717        vocabulary = rating_vocab,
     1718        )
     1719
     1720    personality = schema.Text(
     1721        title = _(u'Please comment on the candidate\'s personality '
     1722            'with particular reference to his/her moral character, emotional '
     1723            'and physical stabilty'),
     1724        required = False,
     1725        )
     1726
     1727    promise = schema.Choice(
     1728        title = _(u'Candidate\'s overall promise'),
     1729        required = False,
     1730        readonly = False,
     1731        vocabulary = overallpromise_vocab,
     1732        )
     1733
     1734    report = schema.Text(
     1735        title = _(u'Any other relevant information which would help '
     1736            'in determining the candidate\'s suitability?'),
     1737        required = False,
     1738        )
     1739
     1740    objection = schema.Text(
     1741        title = _(u'Have you any objection to the contents of this '
     1742            'evaluation being disclosed to any award-given body if '
     1743            'the need arises?'),
     1744        required = False,
     1745        )
     1746
Note: See TracChangeset for help on using the changeset viewer.