source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py @ 9554

Last change on this file since 9554 was 9381, checked in by Henrik Bettermann, 12 years ago

Move secret cults scan to Uniben package. Also JAMB Letter is a Uniben customization. We have a similar field for FUTMinna.

  • Property svn:keywords set to Id
File size: 14.7 KB
RevLine 
[8862]1## $Id: viewlets.py 9381 2012-10-22 07:30:10Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18
19import grok
20from waeup.kofa.students.viewlets import (
21    FileDisplay, FileUpload, Image)
22from waeup.kofa.students.browser import ExportPDFClearanceSlipPage
23
24from kofacustom.nigeria.interfaces import MessageFactory as _
25
[9236]26# Acceptance Letter
27
28class AcceptanceLetterDisplay(FileDisplay):
29    """Acceptance Letter display viewlet.
30    """
31    grok.order(2)
32    label = _(u'Acceptance Letter')
33    title = _(u'Acceptance Letter Scan')
34    download_name = u'acc_let'
35
36class AcceptanceLetterSlip(AcceptanceLetterDisplay):
37    grok.view(ExportPDFClearanceSlipPage)
38
39class AcceptanceLetterUpload(FileUpload):
40    """AcceptanceLetter upload viewlet.
41    """
42    grok.order(2)
43    label = _(u'Acceptance Letter')
44    title = _(u'Acceptance Letter Scan')
45    mus = 1024 * 150
46    download_name = u'acc_let'
47    tab_redirect = '?tab2'
48
49class AcceptanceLetterImage(Image):
50    """Renders acceptance letter scan.
51    """
52    grok.name('acc_let')
53    download_name = u'acc_let'
54
[8862]55# LGA Identification
56
57class LGAIdentificationDisplay(FileDisplay):
58    """LGA Identification display viewlet.
59    """
[9236]60    grok.order(3)
[8862]61    label = _(u'LGA Identification')
62    title = _(u'LGA Identification Scan')
63    download_name = u'lga_ident'
64
65class LGAIdentificationSlip(LGAIdentificationDisplay):
66    grok.view(ExportPDFClearanceSlipPage)
67
68class LGAIdentificationUpload(FileUpload):
69    """LGA Identification upload viewlet.
70    """
[9236]71    grok.order(3)
[8862]72    label = _(u'LGA Identification')
73    title = _(u'LGA Identification Scan')
74    mus = 1024 * 150
75    download_name = u'lga_ident'
76
77class LGAIdentificationImage(Image):
78    """Renders LGA Identification scan.
79    """
80    grok.name('lga_ident')
81    download_name = u'lga_ident'
82
83# First Sitting Result
84
85class FirstSittingResultDisplay(FileDisplay):
86    """First Sitting Result display viewlet.
87    """
[9236]88    grok.order(4)
[8862]89    label = _(u'First Sitting Result')
90    title = _(u'First Sitting Result')
91    download_name = u'fst_sit_scan'
92
93class FirstSittingResultSlip(FirstSittingResultDisplay):
94    grok.view(ExportPDFClearanceSlipPage)
95
96class FirstSittingResultUpload(FileUpload):
97    """First Sitting Result upload viewlet.
98    """
[9236]99    grok.order(4)
[8862]100    label = _(u'First Sitting Result')
101    title = _(u'First Sitting Result Scan')
102    mus = 1024 * 150
103    download_name = u'fst_sit_scan'
104
105class FirstSittingResultImage(Image):
106    """Renders First Sitting Result scan.
107    """
108    grok.name('fst_sit_scan')
109    download_name = u'fst_sit_scan'
110
111# Second Sitting Result
112
113class SecondSittingResultDisplay(FileDisplay):
114    """Second Sitting Result display viewlet.
115    """
[9236]116    grok.order(5)
[8862]117    label = _(u'Second Sitting Result')
118    title = _(u'Second Sitting Result')
119    download_name = u'scd_sit_scan'
120
121class SecondSittingResultSlip(SecondSittingResultDisplay):
122    grok.view(ExportPDFClearanceSlipPage)
123
124class SecondSittingResultUpload(FileUpload):
125    """Second Sitting Result upload viewlet.
126    """
[9236]127    grok.order(5)
[8862]128    label = _(u'Second Sitting Result')
129    title = _(u'Second Sitting Result Scan')
130    mus = 1024 * 150
131    download_name = u'scd_sit_scan'
132
133class SecondSittingResultImage(Image):
134    """Renders Second Sitting Result scan.
135    """
136    grok.name('scd_sit_scan')
137    download_name = u'scd_sit_scan'
138
139# Higher Qualification Result
140
141class HigherQualificationResultDisplay(FileDisplay):
142    """Higher Qualification Result display viewlet.
143    """
[9236]144    grok.order(6)
[8862]145    label = _(u'Higher Qualification Result')
146    title = _(u'Higher Qualification Result')
147    download_name = u'hq_scan'
148
149class HigherQualificationResultSlip(HigherQualificationResultDisplay):
150    grok.view(ExportPDFClearanceSlipPage)
151
152class HigherQualificationResultUpload(FileUpload):
153    """Higher Qualification Result upload viewlet.
154    """
[9236]155    grok.order(6)
[8862]156    label = _(u'Higher Qualification Result')
157    title = _(u'Higher Qualification Result Scan')
158    mus = 1024 * 150
159    download_name = u'hq_scan'
160
161class HigherQualificationResultImage(Image):
162    """Renders Higher Qualification Result scan.
163    """
164    grok.name('hq_scan')
165    download_name = u'hq_scan'
166
167# 2nd Higher Qualification Result (PG Students only)
168
169class SecondHigherQualificationResultDisplay(FileDisplay):
170    """Second Higher Qualification Result display viewlet.
171    """
[9236]172    grok.order(7)
[8862]173    label = _(u'Second Higher Qualification Result')
174    title = _(u'Second Higher Qualification Result')
175    download_name = u'hq_scan2'
176
177class SecondHigherQualificationResultSlip(SecondHigherQualificationResultDisplay):
178    grok.view(ExportPDFClearanceSlipPage)
179
180class SecondHigherQualificationResultUpload(FileUpload):
181    """Second Higher Qualification Result upload viewlet.
182    """
[9236]183    grok.order(7)
[8862]184    label = _(u'Second Higher Qualification Result')
185    title = _(u'Second Higher Qualification Result Scan')
186    mus = 1024 * 150
187    download_name = u'hq_scan2'
188
189    @property
190    def show_viewlet(self):
191        cm = getattr(self.context,'current_mode', None)
192        if cm is not None and cm.startswith('pg'):
193            return True
194        return False
195
196class SecondHigherQualificationResultImage(Image):
197    """Renders Second Higher Qualification Result scan.
198    """
199    grok.name('hq_scan2')
200    download_name = u'hq_scan2'
201
202# Advanced Level Result
203
204class AdvancedLevelResultDisplay(FileDisplay):
205    """Advanced Level Result display viewlet.
206    """
[9236]207    grok.order(8)
[8862]208    label = _(u'Advanced Level Result')
209    title = _(u'Advanced Level Result')
210    download_name = u'alr_scan'
211
212class AdvancedLevelResultSlip(AdvancedLevelResultDisplay):
213    grok.view(ExportPDFClearanceSlipPage)
214
215class AdvancedLevelResultUpload(FileUpload):
216    """Advanced Level Result upload viewlet.
217    """
[9236]218    grok.order(8)
[8862]219    label = _(u'Advanced Level Result')
220    title = _(u'Advanced Level Result Scan')
221    mus = 1024 * 150
222    download_name = u'alr_scan'
223
224class AdvancedLevelResultImage(Image):
225    """Renders Advanced Level Result scan.
226    """
227    grok.name('alr_scan')
228    download_name = u'alr_scan'
229
[9381]230# Certificate
[8862]231
232class CertificateDisplay(FileDisplay):
[9381]233    """Certificate display viewlet.
[8862]234    """
[9236]235    grok.order(9)
[9381]236    label = _(u'Certificate')
237    title = _(u'Certificate')
[9236]238    download_name = u'cert'
[8862]239
240class CertificateSlip(CertificateDisplay):
241    grok.view(ExportPDFClearanceSlipPage)
242
243class CertificateUpload(FileUpload):
[9381]244    """Certificate upload viewlet.
[8862]245    """
[9236]246    grok.order(9)
[9381]247    label = _(u'Certificate')
248    title = _(u'Certificate Scan')
[8862]249    mus = 1024 * 150
[9236]250    download_name = u'cert'
[8862]251
252class CertificateImage(Image):
[9381]253    """Renders Certificate scan.
[8862]254    """
[9236]255    grok.name('cert')
256    download_name = u'cert'
[8862]257
258# Second Certificate (PG Students only)
259
260class SecondCertificateDisplay(FileDisplay):
261    """ Second Certificate display viewlet.
262    """
[9236]263    grok.order(10)
[8862]264    label = _(u'Second Certificate')
265    title = _(u'Second Certificate')
[9236]266    download_name = u'cert2'
[8862]267
268class SecondCertificateSlip(SecondCertificateDisplay):
269    grok.view(ExportPDFClearanceSlipPage)
270
271class SecondCertificateUpload(FileUpload):
272    """Second Certificate upload viewlet.
273    """
[9236]274    grok.order(10)
[8862]275    label = _(u'Second Certificate')
276    title = _(u'Second Certificate Scan')
277    mus = 1024 * 150
[9236]278    download_name = u'cert2'
[8862]279
280    @property
281    def show_viewlet(self):
282        cm = getattr(self.context,'current_mode', None)
283        if cm is not None and cm.startswith('pg'):
284            return True
285        return False
286
[9241]287class SecondCertificateImage(Image):
[8862]288    """Renders Second Certificate scan.
289    """
[9236]290    grok.name('cert2')
291    download_name = u'cert2'
[8862]292
293# Third Certificate (PG Students only)
294
295class ThirdCertificateDisplay(FileDisplay):
296    """ Third Certificate display viewlet.
297    """
[9236]298    grok.order(11)
[8862]299    label = _(u'Third Certificate')
300    title = _(u'Third Certificate')
[9236]301    download_name = u'cert3'
[8862]302
303class ThirdCertificateSlip(ThirdCertificateDisplay):
304    grok.view(ExportPDFClearanceSlipPage)
305
306class ThirdCertificateUpload(FileUpload):
307    """Third Certificate upload viewlet.
308    """
[9236]309    grok.order(11)
[8862]310    label = _(u'Third Certificate')
311    title = _(u'Third Certificate Scan')
312    mus = 1024 * 150
[9236]313    download_name = u'cert3'
[8862]314
315    @property
316    def show_viewlet(self):
317        cm = getattr(self.context,'current_mode', None)
318        if cm is not None and cm.startswith('pg'):
319            return True
320        return False
321
[9241]322class ThirdCertificateImage(Image):
[8862]323    """Renders Third Certificate scan.
324    """
[9236]325    grok.name('cert3')
326    download_name = u'cert3'
[8862]327
328# Evidence of Name
329
330class EvidenceNameDisplay(FileDisplay):
331    """Evidence of Name display viewlet.
332    """
[9236]333    grok.order(12)
[8862]334    label = _(u'Evidence of Name')
335    title = _(u'Evidence of Name')
336    download_name = u'evid'
337
338class EvidenceNameSlip(EvidenceNameDisplay):
339    grok.view(ExportPDFClearanceSlipPage)
340
341class EvidenceNameUpload(FileUpload):
342    """Evidence of Name upload viewlet.
343    """
[9236]344    grok.order(12)
[8862]345    label = _(u'Evidence of Name')
346    title = _(u'Evidence of Name Scan')
347    mus = 1024 * 150
348    download_name = u'evid'
349
350class EvidenceNameImage(Image):
351    """Renders Evidence of Name scan.
352    """
353    grok.name('evid')
354    download_name = u'evid'
355
356# Result Statement
357
358class ResultStatementDisplay(FileDisplay):
359    """Result Statement display viewlet.
360    """
[9236]361    grok.order(13)
[8862]362    label = _(u'Result Statement')
363    title = _(u'Result Statement')
364    download_name = u'res_stat'
365
366class ResultStatementSlip(ResultStatementDisplay):
367    grok.view(ExportPDFClearanceSlipPage)
368
369class ResultStatementUpload(FileUpload):
370    """Result Statement upload viewlet.
371    """
[9236]372    grok.order(13)
[8862]373    label = _(u'Result Statement')
374    title = _(u'Result Statement Scan')
375    mus = 1024 * 150
376    download_name = u'res_stat'
377
378class ResultStatementImage(Image):
379    """Renders Result Statement scan.
380    """
381    grok.name('res_stat')
382    download_name = u'res_stat'
383
384# Referee Letter
385
386class RefereeLetterDisplay(FileDisplay):
387    """Referee Letter display viewlet.
388    """
[9236]389    grok.order(14)
[9377]390    label = _(u'Guarantor/Referee Letter')
391    title = _(u'Guarantor/Referee Letter')
[8862]392    download_name = u'ref_let'
393
394class RefereeLetterSlip(RefereeLetterDisplay):
395    grok.view(ExportPDFClearanceSlipPage)
396
397class RefereeLetterUpload(FileUpload):
398    """Referee Letter upload viewlet.
399    """
[9236]400    grok.order(14)
[9377]401    label = _(u'Guarantor/Referee Letter')
402    title = _(u'Guarantor/Referee Letter Scan')
[8862]403    mus = 1024 * 150
404    download_name = u'ref_let'
405
406class RefereeLetterImage(Image):
407    """Renders Referee Letter scan.
408    """
409    grok.name('ref_let')
410    download_name = u'ref_let'
411
412# Second Referee Letter (PG Students only)
413
414class SecondRefereeLetterDisplay(FileDisplay):
415    """Second Referee Letter display viewlet.
416    """
[9236]417    grok.order(15)
[8862]418    label = _(u'Second Referee Letter')
419    title = _(u'Second Referee Letter')
420    download_name = u'ref_let2'
421
422class SecondRefereeLetterSlip(SecondRefereeLetterDisplay):
423    grok.view(ExportPDFClearanceSlipPage)
424
425class SecondRefereeLetterUpload(FileUpload):
426    """Referee Letter upload viewlet.
427    """
[9236]428    grok.order(15)
[8862]429    label = _(u'Second Referee Letter')
430    title = _(u'Second Referee Letter Scan')
431    mus = 1024 * 150
432    download_name = u'ref_let2'
433
434    @property
435    def show_viewlet(self):
436        cm = getattr(self.context,'current_mode', None)
437        if cm is not None and cm.startswith('pg'):
438            return True
439        return False
440
441class SecondRefereeLetterImage(Image):
442    """Renders Referee Letter scan.
443    """
444    grok.name('ref_let2')
445    download_name = u'ref_let2'
446
447# Third Referee Letter (PG Students only)
448
449class ThirdRefereeLetterDisplay(FileDisplay):
450    """Third Referee Letter display viewlet.
451    """
[9236]452    grok.order(16)
[8862]453    label = _(u'Third Referee Letter')
454    title = _(u'Third Referee Letter')
455    download_name = u'ref_let3'
456
457class ThirdRefereeLetterSlip(ThirdRefereeLetterDisplay):
458    grok.view(ExportPDFClearanceSlipPage)
459
460class ThirdRefereeLetterUpload(FileUpload):
461    """Referee Letter upload viewlet.
462    """
[9236]463    grok.order(16)
[8862]464    label = _(u'Third Referee Letter')
465    title = _(u'Third Referee Letter Scan')
466    mus = 1024 * 150
467    download_name = u'ref_let3'
468
469    @property
470    def show_viewlet(self):
471        cm = getattr(self.context,'current_mode', None)
472        if cm is not None and cm.startswith('pg'):
473            return True
474        return False
475
476class ThirdRefereeLetterImage(Image):
477    """Renders Referee Letter scan.
478    """
479    grok.name('ref_let3')
480    download_name = u'ref_let3'
481
[9377]482# Affidavit (former Statutory Declaration) of Good Conduct
[8862]483
484class StatutoryDeclarationDisplay(FileDisplay):
485    """Statutory Declaration of Good Conduct display viewlet.
486    """
[9236]487    grok.order(17)
[9377]488    label = _(u'Affidavit of Good Conduct')
489    title = _(u'Affidavit of Good Conduct')
[8862]490    download_name = u'stat_dec'
491
492class StatutoryDeclarationSlip(StatutoryDeclarationDisplay):
493    grok.view(ExportPDFClearanceSlipPage)
494
495class StatutoryDeclarationUpload(FileUpload):
496    """Statutory Declaration of Good Conduct upload viewlet.
497    """
[9236]498    grok.order(17)
[9377]499    label = _(u'Affidavit of Good Conduct')
500    title = _(u'Affidavit of Good Conduct Scan')
[8862]501    mus = 1024 * 150
502    download_name = u'stat_dec'
503
504class StatutoryDeclarationImage(Image):
[9377]505    """Renders Affidavit of Good Conduct scan.
[8862]506    """
507    grok.name('stat_dec')
508    download_name = u'stat_dec'
509
510# Letter of Admission (PG Students only)
511
512class LetterAdmissionDisplay(FileDisplay):
513    """Letter of Admission display viewlet.
514    """
[9381]515    grok.order(18)
[8862]516    label = _(u'Letter of Admission')
517    title = _(u'Letter of Admission')
518    download_name = u'admission_let'
519
520class LetterAdmissionSlip(LetterAdmissionDisplay):
521    grok.view(ExportPDFClearanceSlipPage)
522
523class LetterAdmissionUpload(FileUpload):
524    """Letter of Admission upload viewlet.
525    """
[9381]526    grok.order(18)
[8862]527    label = _(u'Letter of Admission')
528    title = _(u'Letter of Admission Scan')
529    mus = 1024 * 150
530    download_name = u'admission_let'
531
532    @property
533    def show_viewlet(self):
534        cm = getattr(self.context,'current_mode', None)
535        if cm is not None and cm.startswith('pg'):
536            return True
537        return False
538
539class LetterAdmissionImage(Image):
540    """Renders Letter of Admission scan.
541    """
542    grok.name('admission_let')
543    download_name = u'admission_let'
Note: See TracBrowser for help on using the repository browser.