[9382] | 1 | ## $Id: viewlets.py 9382 2012-10-22 07:43:24Z 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 | |
---|
| 19 | import grok |
---|
| 20 | from waeup.kofa.students.viewlets import ( |
---|
| 21 | FileDisplay, FileUpload, Image) |
---|
| 22 | from waeup.kofa.students.browser import ExportPDFClearanceSlipPage |
---|
| 23 | |
---|
| 24 | from kofacustom.nigeria.interfaces import MessageFactory as _ |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | # JAMB Letter |
---|
| 28 | |
---|
| 29 | class JAMBLetterDisplay(FileDisplay): |
---|
| 30 | """JAMB Letter display viewlet. |
---|
| 31 | """ |
---|
| 32 | grok.order(19) |
---|
| 33 | label = _(u'JAMB Letter') |
---|
| 34 | title = _(u'JAMB Letter') |
---|
| 35 | download_name = u'cert' |
---|
| 36 | |
---|
| 37 | class JAMBLetterSlip(JAMBLetterDisplay): |
---|
| 38 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 39 | |
---|
| 40 | class JAMBLetterUpload(FileUpload): |
---|
| 41 | """JAMB Letter upload viewlet. |
---|
| 42 | """ |
---|
| 43 | grok.order(19) |
---|
| 44 | label = _(u'JAMB Letter') |
---|
| 45 | title = _(u'JAMB Letter Scan') |
---|
| 46 | mus = 1024 * 150 |
---|
| 47 | download_name = u'cert' |
---|
| 48 | |
---|
| 49 | class JAMBLetterImage(Image): |
---|
| 50 | """Renders JAMB Letter scan. |
---|
| 51 | """ |
---|
| 52 | grok.name('cert') |
---|
| 53 | download_name = u'cert' |
---|
| 54 | |
---|
| 55 | # Affidavit of Non-Membership of Secret Cults |
---|
| 56 | |
---|
| 57 | class SecrCultsStatementDisplay(FileDisplay): |
---|
| 58 | """Affidavit of Non-Membership of Secret Cults display viewlet. |
---|
| 59 | """ |
---|
| 60 | grok.order(20) |
---|
| 61 | label = _(u'Affidavit of Non-Membership of Secret Cults') |
---|
| 62 | title = _(u'Affidavit of Non-Membership of Secret Cults') |
---|
| 63 | download_name = u'secr_cults' |
---|
| 64 | |
---|
| 65 | class SecrCultsStatementSlip(SecrCultsStatementDisplay): |
---|
| 66 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 67 | |
---|
| 68 | class SecrCultsStatementUpload(FileUpload): |
---|
| 69 | """Affidavit of Non-Membership of Secret Cults upload viewlet. |
---|
| 70 | """ |
---|
| 71 | grok.order(20) |
---|
| 72 | label = _(u'Affidavit of Non-Membership of Secret Cults') |
---|
| 73 | title = _(u'Affidavit of Non-Membership of Secret Cults Scan') |
---|
| 74 | mus = 1024 * 150 |
---|
| 75 | download_name = u'secr_cults' |
---|
| 76 | |
---|
| 77 | class ResultStatementImage(Image): |
---|
| 78 | """Renders Affidavit of Non-Membership of Secret Cults scan. |
---|
| 79 | """ |
---|
| 80 | grok.name('secr_cults') |
---|
| 81 | download_name = u'secr_cults' |
---|