Ignore:
Timestamp:
22 Jul 2019, 19:22:40 (5 years ago)
Author:
Henrik Bettermann
Message:

Change admission slip and add watermark.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/browser.py

    r15304 r15507  
    2424from waeup.kofa.interfaces import MessageFactory as _
    2525from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
     26from waeup.kofa.students.interfaces import IStudentsUtils
    2627from waeup.kofa.students.browser import (
    2728    StartClearancePage, BedTicketAddPage,
     
    4849    def label(self):
    4950        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    50         return translate(_('Admission Letter of'),
    51             'waeup.kofa', target_language=portal_language) \
    52             + ' %s' % self.context.display_fullname
    53 
    54     @property
    55     def label(self):
    56         portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    5751        line0 = ''
    5852        if self.context.student.current_mode.startswith('ug'):
     
    6256            + ' %s' % self.context.display_fullname
    6357        return '%s%s' % (line0, line1)
     58
     59    @property
     60    def _post_text(self):
     61        return """You should note the following as conditions for admission:
     62
     631.      At the point of registration, you will be required to present the originals of your certificate(s), Jamb Original Result, a Birth Certificate or a Declaration of Age Certificate and Evidence of Citizenship Certificate
     64
     652.      Please note that the name by which you are hereby admitted and by which you will be registered is the one which will appear on any certificate that the Federal College of Education, Okene may issue to you on successful completion of your programme except there was a change of name by sworn affidavit or marriage certificate in addition to newspaper publication.
     66
     673.      You are hereby informed that all fees must be paid at the beginning of the academic session. The current school fees can be obtained from the College website.
     68
     694.      You will present at the time of registration the Medical Certificate of Fitness from the Federal College of Education, Okene Medical Centre.
     70
     715.      Please, note that due to shortage of accommodations, students shall be given accommodations on first come, first serve basis.
     72
     736.      The offer is not transferable to another session.
     74
     757.      You will sign a declaration of good conduct except by deferment on your arrival at the College.
     76
     77Accept my congratulations.
     78
     79Yours faithfully
     80
     81M. S. Adoke
     82Deputy Registrar (Admissions)
     83For: Registrar
     84"""
     85
     86
     87    def render(self):
     88        students_utils = getUtility(IStudentsUtils)
     89        return students_utils.renderPDFAdmissionLetter(self,
     90            self.context.student, omit_fields=self.omit_fields,
     91            post_text=self._post_text)
    6492
    6593class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage):
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r15300 r15507  
    378378        return
    379379
    380     def test_admission_slip_link(self):
     380    def test_admission_slip(self):
    381381        # Login
    382382        IWorkflowState(self.student).setState('admitted')
     
    391391        self.assertTrue(
    392392          'Download admission letter' in self.browser.contents)
     393        # Students can open admission letter
     394        self.browser.getLink("Download admission letter").click()
     395        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     396        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     397        path = os.path.join(samples_dir(), 'admission_slip.pdf')
     398        open(path, 'wb').write(self.browser.contents)
     399        print "Sample PDF admission_slip.pdf written to %s" % path
    393400        return
    394401
Note: See TracChangeset for help on using the changeset viewer.