1 | ## $Id: viewlets.py 8108 2012-04-11 13:52:36Z 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 waeup.uniben.interfaces import MessageFactory as _ |
---|
25 | |
---|
26 | # LGA Identification |
---|
27 | |
---|
28 | class LGAIdentificationDisplay(FileDisplay): |
---|
29 | """LGA Identification display viewlet. |
---|
30 | """ |
---|
31 | grok.order(1) |
---|
32 | label = _(u'LGA Identification') |
---|
33 | title = _(u'LGA Identification Scan') |
---|
34 | download_name = u'lga_ident' |
---|
35 | |
---|
36 | class LGAIdentificationSlip(LGAIdentificationDisplay): |
---|
37 | grok.view(ExportPDFClearanceSlipPage) |
---|
38 | |
---|
39 | class LGAIdentificationUpload(FileUpload): |
---|
40 | """LGA Identification upload viewlet. |
---|
41 | """ |
---|
42 | grok.order(2) |
---|
43 | label = _(u'LGA Identification') |
---|
44 | title = _(u'LGA Identification Scan') |
---|
45 | mus = 1024 * 150 |
---|
46 | download_name = u'lga_ident' |
---|
47 | tab_redirect = '?tab2' |
---|
48 | |
---|
49 | class LGAIdentificationImage(Image): |
---|
50 | """Renders LGA Identification scan. |
---|
51 | """ |
---|
52 | grok.name('lga_ident') |
---|
53 | download_name = u'lga_ident' |
---|
54 | |
---|
55 | # First Sitting Result |
---|
56 | |
---|
57 | class FirstSittingResultDisplay(FileDisplay): |
---|
58 | """First Sitting Result display viewlet. |
---|
59 | """ |
---|
60 | grok.order(1) |
---|
61 | label = _(u'First Sitting Result') |
---|
62 | title = _(u'First Sitting Result') |
---|
63 | download_name = u'fst_sit_scan' |
---|
64 | |
---|
65 | class FirstSittingResultSlip(FirstSittingResultDisplay): |
---|
66 | grok.view(ExportPDFClearanceSlipPage) |
---|
67 | |
---|
68 | class FirstSittingResultUpload(FileUpload): |
---|
69 | """First Sitting Result upload viewlet. |
---|
70 | """ |
---|
71 | grok.order(2) |
---|
72 | label = _(u'First Sitting Result') |
---|
73 | title = _(u'First Sitting Result Scan') |
---|
74 | mus = 1024 * 150 |
---|
75 | download_name = u'fst_sit_scan' |
---|
76 | tab_redirect = '?tab2' |
---|
77 | |
---|
78 | class FirstSittingResultImage(Image): |
---|
79 | """Renders First Sitting Result scan. |
---|
80 | """ |
---|
81 | grok.name('fst_sit_scan') |
---|
82 | download_name = u'fst_sit_scan' |
---|
83 | |
---|
84 | # Second Sitting Result |
---|
85 | |
---|
86 | class SecondSittingResultDisplay(FileDisplay): |
---|
87 | """Second Sitting Result display viewlet. |
---|
88 | """ |
---|
89 | grok.order(1) |
---|
90 | label = _(u'Second Sitting Result') |
---|
91 | title = _(u'Second Sitting Result') |
---|
92 | download_name = u'scd_sit_scan' |
---|
93 | |
---|
94 | class SecondSittingResultSlip(SecondSittingResultDisplay): |
---|
95 | grok.view(ExportPDFClearanceSlipPage) |
---|
96 | |
---|
97 | class SecondSittingResultUpload(FileUpload): |
---|
98 | """Second Sitting Result upload viewlet. |
---|
99 | """ |
---|
100 | grok.order(2) |
---|
101 | label = _(u'Second Sitting Result') |
---|
102 | title = _(u'Second Sitting Result Scan') |
---|
103 | mus = 1024 * 150 |
---|
104 | download_name = u'scd_sit_scan' |
---|
105 | tab_redirect = '?tab2' |
---|
106 | |
---|
107 | class SecondSittingResultImage(Image): |
---|
108 | """Renders Second Sitting Result scan. |
---|
109 | """ |
---|
110 | grok.name('scd_sit_scan') |
---|
111 | download_name = u'scd_sit_scan' |
---|
112 | |
---|
113 | # Higher Qualification Result |
---|
114 | |
---|
115 | class HigherQualificationResultDisplay(FileDisplay): |
---|
116 | """Higher Qualification Result display viewlet. |
---|
117 | """ |
---|
118 | grok.order(1) |
---|
119 | label = _(u'Higher Qualification Result') |
---|
120 | title = _(u'Higher Qualification Result') |
---|
121 | download_name = u'hq_scan' |
---|
122 | |
---|
123 | class HigherQualificationResultSlip(HigherQualificationResultDisplay): |
---|
124 | grok.view(ExportPDFClearanceSlipPage) |
---|
125 | |
---|
126 | class HigherQualificationResultUpload(FileUpload): |
---|
127 | """Higher Qualification Result upload viewlet. |
---|
128 | """ |
---|
129 | grok.order(2) |
---|
130 | label = _(u'Higher Qualification Result') |
---|
131 | title = _(u'Higher Qualification Result Scan') |
---|
132 | mus = 1024 * 150 |
---|
133 | download_name = u'hq_scan' |
---|
134 | tab_redirect = '?tab2' |
---|
135 | |
---|
136 | class HigherQualificationResultImage(Image): |
---|
137 | """Renders Higher Qualification Result scan. |
---|
138 | """ |
---|
139 | grok.name('hq_scan') |
---|
140 | download_name = u'hq_scan' |
---|
141 | |
---|
142 | # 2nd Higher Qualification Result |
---|
143 | |
---|
144 | class SecondHigherQualificationResultDisplay(FileDisplay): |
---|
145 | """Second Higher Qualification Result display viewlet. |
---|
146 | """ |
---|
147 | grok.order(1) |
---|
148 | label = _(u'Second Higher Qualification Result') |
---|
149 | title = _(u'Second Higher Qualification Result') |
---|
150 | download_name = u'hq_scan2' |
---|
151 | |
---|
152 | class SecondHigherQualificationResultSlip(SecondHigherQualificationResultDisplay): |
---|
153 | grok.view(ExportPDFClearanceSlipPage) |
---|
154 | |
---|
155 | class SecondHigherQualificationResultUpload(FileUpload): |
---|
156 | """Second Higher Qualification Result upload viewlet. |
---|
157 | """ |
---|
158 | grok.order(2) |
---|
159 | label = _(u'Second Higher Qualification Result') |
---|
160 | title = _(u'Second Higher Qualification Result Scan') |
---|
161 | mus = 1024 * 150 |
---|
162 | download_name = u'hq_scan2' |
---|
163 | tab_redirect = '?tab2' |
---|
164 | |
---|
165 | class SecondHigherQualificationResultImage(Image): |
---|
166 | """Renders Second Higher Qualification Result scan. |
---|
167 | """ |
---|
168 | grok.name('hq_scan2') |
---|
169 | download_name = u'hq_scan2' |
---|
170 | |
---|
171 | # Evidence of Name |
---|
172 | |
---|
173 | class EvidenceOfNameDisplay(FileDisplay): |
---|
174 | """Evidence of Name display viewlet. |
---|
175 | """ |
---|
176 | grok.order(1) |
---|
177 | label = _(u'Evidence of Name') |
---|
178 | title = _(u'Evidence of Name') |
---|
179 | download_name = u'evid' |
---|
180 | |
---|
181 | class EvidenceOfNameSlip(EvidenceOfNameDisplay): |
---|
182 | grok.view(ExportPDFClearanceSlipPage) |
---|
183 | |
---|
184 | class EvidenceOfNameUpload(FileUpload): |
---|
185 | """Evidence of Name upload viewlet. |
---|
186 | """ |
---|
187 | grok.order(2) |
---|
188 | label = _(u'Evidence of Name') |
---|
189 | title = _(u'Evidence of Name Scan') |
---|
190 | mus = 1024 * 150 |
---|
191 | download_name = u'evid' |
---|
192 | tab_redirect = '?tab2' |
---|
193 | |
---|
194 | class EvidenceOfNameImage(Image): |
---|
195 | """Renders Evidence of Name scan. |
---|
196 | """ |
---|
197 | grok.name('evid') |
---|
198 | download_name = u'evid' |
---|