[9240] | 1 | ## $Id: viewlets.py 9872 2013-01-12 07:10:56Z 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 |
---|
[9872] | 23 | from waeup.kofa.students.viewlets import ( |
---|
| 24 | AddPreviousPaymentActionButton, AddBalancePaymentActionButton) |
---|
[9240] | 25 | |
---|
| 26 | from kofacustom.nigeria.interfaces import MessageFactory as _ |
---|
| 27 | |
---|
| 28 | |
---|
[9523] | 29 | class AddPreviousPaymentActionButton(AddPreviousPaymentActionButton): |
---|
| 30 | |
---|
| 31 | @property |
---|
| 32 | def target_url(self): |
---|
| 33 | return '' |
---|
| 34 | |
---|
[9872] | 35 | class AddBalancePaymentActionButton(AddBalancePaymentActionButton): |
---|
| 36 | |
---|
| 37 | @property |
---|
| 38 | def target_url(self): |
---|
| 39 | return '' |
---|
| 40 | |
---|
[9240] | 41 | # Accepted by Institution |
---|
| 42 | |
---|
| 43 | class AcceptedByInstitutionDisplay(FileDisplay): |
---|
| 44 | """Accepted by Institution display viewlet. |
---|
| 45 | """ |
---|
| 46 | grok.order(19) |
---|
| 47 | label = _(u'Accepted by Institution') |
---|
| 48 | title = _(u'Accepted by Institution') |
---|
| 49 | download_name = u'acc_inst' |
---|
| 50 | |
---|
| 51 | class AcceptedByInstitutionSlip(AcceptedByInstitutionDisplay): |
---|
| 52 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 53 | |
---|
| 54 | class AcceptedByInstitutionUpload(FileUpload): |
---|
| 55 | """Accepted by Institution upload viewlet. |
---|
| 56 | """ |
---|
| 57 | grok.order(19) |
---|
| 58 | label = _(u'Accepted by Institution') |
---|
| 59 | title = _(u'Accepted by Institution Scan') |
---|
| 60 | mus = 1024 * 150 |
---|
| 61 | download_name = u'acc_inst' |
---|
| 62 | |
---|
| 63 | class AcceptedByInstitutionImage(Image): |
---|
| 64 | """Renders Accepted by Institution scan. |
---|
| 65 | """ |
---|
| 66 | grok.name('acc_inst') |
---|
| 67 | download_name = u'acc_inst' |
---|
| 68 | |
---|
| 69 | # Credential |
---|
| 70 | |
---|
| 71 | class CredentialDisplay(FileDisplay): |
---|
| 72 | """Credential display viewlet. |
---|
| 73 | """ |
---|
| 74 | grok.order(20) |
---|
| 75 | label = _(u'Credential') |
---|
| 76 | title = _(u'Credential') |
---|
| 77 | download_name = u'cred' |
---|
| 78 | |
---|
| 79 | class CredentialSlip(CredentialDisplay): |
---|
| 80 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 81 | |
---|
| 82 | class CredentialUpload(FileUpload): |
---|
| 83 | """Credential upload viewlet. |
---|
| 84 | """ |
---|
| 85 | grok.order(20) |
---|
| 86 | label = _(u'Credential') |
---|
| 87 | title = _(u'Credential') |
---|
| 88 | mus = 1024 * 150 |
---|
| 89 | download_name = u'cred' |
---|
| 90 | |
---|
| 91 | class CredentialImage(Image): |
---|
| 92 | """Credential scan. |
---|
| 93 | """ |
---|
| 94 | grok.name('cred') |
---|
[9242] | 95 | download_name = u'cred' |
---|
[9240] | 96 | |
---|
| 97 | # Student Signature |
---|
| 98 | |
---|
| 99 | class StudentSignatureDisplay(FileDisplay): |
---|
| 100 | """Student Signature display viewlet. |
---|
| 101 | """ |
---|
| 102 | grok.order(21) |
---|
| 103 | label = _(u'Student Signature') |
---|
| 104 | title = _(u'Student Signature') |
---|
| 105 | download_name = u'signature' |
---|
| 106 | |
---|
| 107 | class StudentSignatureSlip(StudentSignatureDisplay): |
---|
| 108 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 109 | |
---|
| 110 | class StudentSignatureUpload(FileUpload): |
---|
| 111 | """Student Signature upload viewlet. |
---|
| 112 | """ |
---|
| 113 | grok.order(21) |
---|
| 114 | label = _(u'Student Signature') |
---|
| 115 | title = _(u'Student Signature') |
---|
| 116 | mus = 1024 * 150 |
---|
| 117 | download_name = u'signature' |
---|
| 118 | |
---|
| 119 | class StudentSignatureImage(Image): |
---|
| 120 | """Student Signature scan. |
---|
| 121 | """ |
---|
| 122 | grok.name('signature') |
---|
| 123 | download_name = u'signature' |
---|
| 124 | |
---|
| 125 | # JAMB Letter |
---|
| 126 | |
---|
| 127 | class JAMBLetterDisplay(FileDisplay): |
---|
| 128 | """JAMB Letter display viewlet. |
---|
| 129 | """ |
---|
| 130 | grok.order(23) |
---|
| 131 | label = _(u'JAMB Letter') |
---|
| 132 | title = _(u'JAMB Letter') |
---|
| 133 | download_name = u'jamb_let' |
---|
| 134 | |
---|
| 135 | class JAMBLetterSlip(JAMBLetterDisplay): |
---|
| 136 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 137 | |
---|
| 138 | class JAMBLetterUpload(FileUpload): |
---|
| 139 | """JAMB Letter upload viewlet. |
---|
| 140 | """ |
---|
| 141 | grok.order(23) |
---|
| 142 | label = _(u'JAMB Letter') |
---|
| 143 | title = _(u'JAMB Letter') |
---|
| 144 | mus = 1024 * 150 |
---|
| 145 | download_name = u'jamb_let' |
---|
| 146 | |
---|
| 147 | class JAMBLetterImage(Image): |
---|
| 148 | """JAMB Letter scan. |
---|
| 149 | """ |
---|
| 150 | grok.name('jamb_let') |
---|
| 151 | download_name = u'jamb_let' |
---|
| 152 | |
---|
| 153 | # JAMB Slip |
---|
| 154 | |
---|
| 155 | class JAMBSlipDisplay(FileDisplay): |
---|
| 156 | """JAMB Slip display viewlet. |
---|
| 157 | """ |
---|
| 158 | grok.order(24) |
---|
| 159 | label = _(u'JAMB Slip') |
---|
| 160 | title = _(u'JAMB Slip') |
---|
| 161 | download_name = u'jamb_slip' |
---|
| 162 | |
---|
| 163 | class JAMBSlipSlip(JAMBSlipDisplay): |
---|
| 164 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 165 | |
---|
| 166 | class JAMBSlipUpload(FileUpload): |
---|
| 167 | """JAMB Slip upload viewlet. |
---|
| 168 | """ |
---|
| 169 | grok.order(24) |
---|
| 170 | label = _(u'JAMB Slip') |
---|
| 171 | title = _(u'JAMB Slip') |
---|
| 172 | mus = 1024 * 150 |
---|
| 173 | download_name = u'jamb_slip' |
---|
| 174 | |
---|
| 175 | class JAMBSlipImage(Image): |
---|
| 176 | """JAMB Slip scan. |
---|
| 177 | """ |
---|
| 178 | grok.name('jamb_slip') |
---|
| 179 | download_name = u'jamb_slip' |
---|
| 180 | |
---|
| 181 | # Age Declaration |
---|
| 182 | |
---|
| 183 | class AgeDeclarationDisplay(FileDisplay): |
---|
| 184 | """Age Declaration display viewlet. |
---|
| 185 | """ |
---|
| 186 | grok.order(25) |
---|
| 187 | label = _(u'Age Declaration') |
---|
| 188 | title = _(u'Age Declaration') |
---|
| 189 | download_name = u'age_dec' |
---|
| 190 | |
---|
| 191 | class AgeDeclarationSlip(AgeDeclarationDisplay): |
---|
| 192 | grok.view(ExportPDFClearanceSlipPage) |
---|
| 193 | |
---|
| 194 | class AgeDeclarationUpload(FileUpload): |
---|
| 195 | """Age Declaration upload viewlet. |
---|
| 196 | """ |
---|
| 197 | grok.order(25) |
---|
| 198 | label = _(u'Age Declaration') |
---|
| 199 | title = _(u'Age Declaration') |
---|
| 200 | mus = 1024 * 150 |
---|
| 201 | download_name = u'age_dec' |
---|
| 202 | |
---|
| 203 | class AgeDeclarationImage(Image): |
---|
| 204 | """Age Declaration scan. |
---|
| 205 | """ |
---|
| 206 | grok.name('age_dec') |
---|
| 207 | download_name = u'age_dec' |
---|