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