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