## $Id: viewlets.py 9377 2012-10-22 05:15:19Z henrik $ ## ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## import grok from waeup.kofa.students.viewlets import ( FileDisplay, FileUpload, Image) from waeup.kofa.students.browser import ExportPDFClearanceSlipPage from kofacustom.nigeria.interfaces import MessageFactory as _ # Acceptance Letter class AcceptanceLetterDisplay(FileDisplay): """Acceptance Letter display viewlet. """ grok.order(2) label = _(u'Acceptance Letter') title = _(u'Acceptance Letter Scan') download_name = u'acc_let' class AcceptanceLetterSlip(AcceptanceLetterDisplay): grok.view(ExportPDFClearanceSlipPage) class AcceptanceLetterUpload(FileUpload): """AcceptanceLetter upload viewlet. """ grok.order(2) label = _(u'Acceptance Letter') title = _(u'Acceptance Letter Scan') mus = 1024 * 150 download_name = u'acc_let' tab_redirect = '?tab2' class AcceptanceLetterImage(Image): """Renders acceptance letter scan. """ grok.name('acc_let') download_name = u'acc_let' # LGA Identification class LGAIdentificationDisplay(FileDisplay): """LGA Identification display viewlet. """ grok.order(3) label = _(u'LGA Identification') title = _(u'LGA Identification Scan') download_name = u'lga_ident' class LGAIdentificationSlip(LGAIdentificationDisplay): grok.view(ExportPDFClearanceSlipPage) class LGAIdentificationUpload(FileUpload): """LGA Identification upload viewlet. """ grok.order(3) label = _(u'LGA Identification') title = _(u'LGA Identification Scan') mus = 1024 * 150 download_name = u'lga_ident' class LGAIdentificationImage(Image): """Renders LGA Identification scan. """ grok.name('lga_ident') download_name = u'lga_ident' # First Sitting Result class FirstSittingResultDisplay(FileDisplay): """First Sitting Result display viewlet. """ grok.order(4) label = _(u'First Sitting Result') title = _(u'First Sitting Result') download_name = u'fst_sit_scan' class FirstSittingResultSlip(FirstSittingResultDisplay): grok.view(ExportPDFClearanceSlipPage) class FirstSittingResultUpload(FileUpload): """First Sitting Result upload viewlet. """ grok.order(4) label = _(u'First Sitting Result') title = _(u'First Sitting Result Scan') mus = 1024 * 150 download_name = u'fst_sit_scan' class FirstSittingResultImage(Image): """Renders First Sitting Result scan. """ grok.name('fst_sit_scan') download_name = u'fst_sit_scan' # Second Sitting Result class SecondSittingResultDisplay(FileDisplay): """Second Sitting Result display viewlet. """ grok.order(5) label = _(u'Second Sitting Result') title = _(u'Second Sitting Result') download_name = u'scd_sit_scan' class SecondSittingResultSlip(SecondSittingResultDisplay): grok.view(ExportPDFClearanceSlipPage) class SecondSittingResultUpload(FileUpload): """Second Sitting Result upload viewlet. """ grok.order(5) label = _(u'Second Sitting Result') title = _(u'Second Sitting Result Scan') mus = 1024 * 150 download_name = u'scd_sit_scan' class SecondSittingResultImage(Image): """Renders Second Sitting Result scan. """ grok.name('scd_sit_scan') download_name = u'scd_sit_scan' # Higher Qualification Result class HigherQualificationResultDisplay(FileDisplay): """Higher Qualification Result display viewlet. """ grok.order(6) label = _(u'Higher Qualification Result') title = _(u'Higher Qualification Result') download_name = u'hq_scan' class HigherQualificationResultSlip(HigherQualificationResultDisplay): grok.view(ExportPDFClearanceSlipPage) class HigherQualificationResultUpload(FileUpload): """Higher Qualification Result upload viewlet. """ grok.order(6) label = _(u'Higher Qualification Result') title = _(u'Higher Qualification Result Scan') mus = 1024 * 150 download_name = u'hq_scan' class HigherQualificationResultImage(Image): """Renders Higher Qualification Result scan. """ grok.name('hq_scan') download_name = u'hq_scan' # 2nd Higher Qualification Result (PG Students only) class SecondHigherQualificationResultDisplay(FileDisplay): """Second Higher Qualification Result display viewlet. """ grok.order(7) label = _(u'Second Higher Qualification Result') title = _(u'Second Higher Qualification Result') download_name = u'hq_scan2' class SecondHigherQualificationResultSlip(SecondHigherQualificationResultDisplay): grok.view(ExportPDFClearanceSlipPage) class SecondHigherQualificationResultUpload(FileUpload): """Second Higher Qualification Result upload viewlet. """ grok.order(7) label = _(u'Second Higher Qualification Result') title = _(u'Second Higher Qualification Result Scan') mus = 1024 * 150 download_name = u'hq_scan2' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class SecondHigherQualificationResultImage(Image): """Renders Second Higher Qualification Result scan. """ grok.name('hq_scan2') download_name = u'hq_scan2' # Advanced Level Result class AdvancedLevelResultDisplay(FileDisplay): """Advanced Level Result display viewlet. """ grok.order(8) label = _(u'Advanced Level Result') title = _(u'Advanced Level Result') download_name = u'alr_scan' class AdvancedLevelResultSlip(AdvancedLevelResultDisplay): grok.view(ExportPDFClearanceSlipPage) class AdvancedLevelResultUpload(FileUpload): """Advanced Level Result upload viewlet. """ grok.order(8) label = _(u'Advanced Level Result') title = _(u'Advanced Level Result Scan') mus = 1024 * 150 download_name = u'alr_scan' class AdvancedLevelResultImage(Image): """Renders Advanced Level Result scan. """ grok.name('alr_scan') download_name = u'alr_scan' # JAMB Letter/Certificate class CertificateDisplay(FileDisplay): """JAMB Letter/Certificate display viewlet. """ grok.order(9) label = _(u'JAMB Letter/Certificate') title = _(u'JAMB Letter/Certificate') download_name = u'cert' class CertificateSlip(CertificateDisplay): grok.view(ExportPDFClearanceSlipPage) class CertificateUpload(FileUpload): """JAMB Letter/Certificate upload viewlet. """ grok.order(9) label = _(u'JAMB Letter/Certificate') title = _(u'JAMB Letter/Certificate Scan') mus = 1024 * 150 download_name = u'cert' class CertificateImage(Image): """Renders JAMB Letter/Certificate scan. """ grok.name('cert') download_name = u'cert' # Second Certificate (PG Students only) class SecondCertificateDisplay(FileDisplay): """ Second Certificate display viewlet. """ grok.order(10) label = _(u'Second Certificate') title = _(u'Second Certificate') download_name = u'cert2' class SecondCertificateSlip(SecondCertificateDisplay): grok.view(ExportPDFClearanceSlipPage) class SecondCertificateUpload(FileUpload): """Second Certificate upload viewlet. """ grok.order(10) label = _(u'Second Certificate') title = _(u'Second Certificate Scan') mus = 1024 * 150 download_name = u'cert2' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class SecondCertificateImage(Image): """Renders Second Certificate scan. """ grok.name('cert2') download_name = u'cert2' # Third Certificate (PG Students only) class ThirdCertificateDisplay(FileDisplay): """ Third Certificate display viewlet. """ grok.order(11) label = _(u'Third Certificate') title = _(u'Third Certificate') download_name = u'cert3' class ThirdCertificateSlip(ThirdCertificateDisplay): grok.view(ExportPDFClearanceSlipPage) class ThirdCertificateUpload(FileUpload): """Third Certificate upload viewlet. """ grok.order(11) label = _(u'Third Certificate') title = _(u'Third Certificate Scan') mus = 1024 * 150 download_name = u'cert3' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class ThirdCertificateImage(Image): """Renders Third Certificate scan. """ grok.name('cert3') download_name = u'cert3' # Evidence of Name class EvidenceNameDisplay(FileDisplay): """Evidence of Name display viewlet. """ grok.order(12) label = _(u'Evidence of Name') title = _(u'Evidence of Name') download_name = u'evid' class EvidenceNameSlip(EvidenceNameDisplay): grok.view(ExportPDFClearanceSlipPage) class EvidenceNameUpload(FileUpload): """Evidence of Name upload viewlet. """ grok.order(12) label = _(u'Evidence of Name') title = _(u'Evidence of Name Scan') mus = 1024 * 150 download_name = u'evid' class EvidenceNameImage(Image): """Renders Evidence of Name scan. """ grok.name('evid') download_name = u'evid' # Result Statement class ResultStatementDisplay(FileDisplay): """Result Statement display viewlet. """ grok.order(13) label = _(u'Result Statement') title = _(u'Result Statement') download_name = u'res_stat' class ResultStatementSlip(ResultStatementDisplay): grok.view(ExportPDFClearanceSlipPage) class ResultStatementUpload(FileUpload): """Result Statement upload viewlet. """ grok.order(13) label = _(u'Result Statement') title = _(u'Result Statement Scan') mus = 1024 * 150 download_name = u'res_stat' class ResultStatementImage(Image): """Renders Result Statement scan. """ grok.name('res_stat') download_name = u'res_stat' # Referee Letter class RefereeLetterDisplay(FileDisplay): """Referee Letter display viewlet. """ grok.order(14) label = _(u'Guarantor/Referee Letter') title = _(u'Guarantor/Referee Letter') download_name = u'ref_let' class RefereeLetterSlip(RefereeLetterDisplay): grok.view(ExportPDFClearanceSlipPage) class RefereeLetterUpload(FileUpload): """Referee Letter upload viewlet. """ grok.order(14) label = _(u'Guarantor/Referee Letter') title = _(u'Guarantor/Referee Letter Scan') mus = 1024 * 150 download_name = u'ref_let' class RefereeLetterImage(Image): """Renders Referee Letter scan. """ grok.name('ref_let') download_name = u'ref_let' # Second Referee Letter (PG Students only) class SecondRefereeLetterDisplay(FileDisplay): """Second Referee Letter display viewlet. """ grok.order(15) label = _(u'Second Referee Letter') title = _(u'Second Referee Letter') download_name = u'ref_let2' class SecondRefereeLetterSlip(SecondRefereeLetterDisplay): grok.view(ExportPDFClearanceSlipPage) class SecondRefereeLetterUpload(FileUpload): """Referee Letter upload viewlet. """ grok.order(15) label = _(u'Second Referee Letter') title = _(u'Second Referee Letter Scan') mus = 1024 * 150 download_name = u'ref_let2' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class SecondRefereeLetterImage(Image): """Renders Referee Letter scan. """ grok.name('ref_let2') download_name = u'ref_let2' # Third Referee Letter (PG Students only) class ThirdRefereeLetterDisplay(FileDisplay): """Third Referee Letter display viewlet. """ grok.order(16) label = _(u'Third Referee Letter') title = _(u'Third Referee Letter') download_name = u'ref_let3' class ThirdRefereeLetterSlip(ThirdRefereeLetterDisplay): grok.view(ExportPDFClearanceSlipPage) class ThirdRefereeLetterUpload(FileUpload): """Referee Letter upload viewlet. """ grok.order(16) label = _(u'Third Referee Letter') title = _(u'Third Referee Letter Scan') mus = 1024 * 150 download_name = u'ref_let3' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class ThirdRefereeLetterImage(Image): """Renders Referee Letter scan. """ grok.name('ref_let3') download_name = u'ref_let3' # Affidavit (former Statutory Declaration) of Good Conduct class StatutoryDeclarationDisplay(FileDisplay): """Statutory Declaration of Good Conduct display viewlet. """ grok.order(17) label = _(u'Affidavit of Good Conduct') title = _(u'Affidavit of Good Conduct') download_name = u'stat_dec' class StatutoryDeclarationSlip(StatutoryDeclarationDisplay): grok.view(ExportPDFClearanceSlipPage) class StatutoryDeclarationUpload(FileUpload): """Statutory Declaration of Good Conduct upload viewlet. """ grok.order(17) label = _(u'Affidavit of Good Conduct') title = _(u'Affidavit of Good Conduct Scan') mus = 1024 * 150 download_name = u'stat_dec' class StatutoryDeclarationImage(Image): """Renders Affidavit of Good Conduct scan. """ grok.name('stat_dec') download_name = u'stat_dec' # Affidavit of Non-Menbership of Secret Cults class SecrCultsStatementDisplay(FileDisplay): """Affidavit of Non-Menbership of Secret Cults display viewlet. """ grok.order(18) label = _(u'Affidavit of Non-Menbership of Secret Cults') title = _(u'Affidavit of Non-Menbership of Secret Cults') download_name = u'secr_cults' class SecrCultsStatementSlip(SecrCultsStatementDisplay): grok.view(ExportPDFClearanceSlipPage) class SecrCultsStatementUpload(FileUpload): """Affidavit of Non-Menbership of Secret Cults upload viewlet. """ grok.order(18) label = _(u'Affidavit of Non-Menbership of Secret Cults') title = _(u'Affidavit of Non-Menbership of Secret Cults Scan') mus = 1024 * 150 download_name = u'secr_cults' class ResultStatementImage(Image): """Renders Affidavit of Non-Menbership of Secret Cults scan. """ grok.name('secr_cults') download_name = u'secr_cults' # Letter of Admission (PG Students only) class LetterAdmissionDisplay(FileDisplay): """Letter of Admission display viewlet. """ grok.order(19) label = _(u'Letter of Admission') title = _(u'Letter of Admission') download_name = u'admission_let' class LetterAdmissionSlip(LetterAdmissionDisplay): grok.view(ExportPDFClearanceSlipPage) class LetterAdmissionUpload(FileUpload): """Letter of Admission upload viewlet. """ grok.order(19) label = _(u'Letter of Admission') title = _(u'Letter of Admission Scan') mus = 1024 * 150 download_name = u'admission_let' @property def show_viewlet(self): cm = getattr(self.context,'current_mode', None) if cm is not None and cm.startswith('pg'): return True return False class LetterAdmissionImage(Image): """Renders Letter of Admission scan. """ grok.name('admission_let') download_name = u'admission_let'