source: main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py @ 9489

Last change on this file since 9489 was 9439, checked in by Henrik Bettermann, 12 years ago

Viewlets should be in viewlets.py.

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1## $Id: viewlets.py 9439 2012-10-27 06:18:08Z 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
19import grok
20from waeup.kofa.interfaces import REQUESTED
21from waeup.kofa.browser.viewlets import ManageActionButton
22from waeup.uniben.students.interfaces import ICustomStudentStudyCourse
23from waeup.kofa.students.viewlets import (
24    FileDisplay, FileUpload, Image)
25from waeup.kofa.students.browser import (
26    ExportPDFClearanceSlipPage, StudyCourseDisplayFormPage)
27
28from kofacustom.nigeria.interfaces import MessageFactory as _
29
30class StudyCourseEditActionButton(ManageActionButton):
31    grok.order(1)
32    grok.context(ICustomStudentStudyCourse)
33    grok.view(StudyCourseDisplayFormPage)
34    grok.require('waeup.clearStudent')
35    text = _('Edit level')
36    target = 'edit_level'
37
38    @property
39    def target_url(self):
40        if self.context.is_current and self.context.student.state == REQUESTED:
41            return self.view.url(self.view.context, self.target)
42        return False
43
44# JAMB Letter
45
46class JAMBLetterDisplay(FileDisplay):
47    """JAMB Letter display viewlet.
48    """
49    grok.order(19)
50    label = _(u'JAMB Letter')
51    title = _(u'JAMB Letter')
52    download_name = u'cert'
53
54class JAMBLetterSlip(JAMBLetterDisplay):
55    grok.view(ExportPDFClearanceSlipPage)
56
57class JAMBLetterUpload(FileUpload):
58    """JAMB Letter upload viewlet.
59    """
60    grok.order(19)
61    label = _(u'JAMB Letter')
62    title = _(u'JAMB Letter Scan')
63    mus = 1024 * 150
64    download_name = u'cert'
65
66class JAMBLetterImage(Image):
67    """Renders JAMB Letter scan.
68    """
69    grok.name('cert')
70    download_name = u'cert'
71
72# Affidavit of Non-Membership of Secret Cults
73
74class SecrCultsStatementDisplay(FileDisplay):
75    """Affidavit of Non-Membership of Secret Cults display viewlet.
76    """
77    grok.order(20)
78    label = _(u'Affidavit of Non-Membership of Secret Cults')
79    title = _(u'Affidavit of Non-Membership of Secret Cults')
80    download_name = u'secr_cults'
81
82class SecrCultsStatementSlip(SecrCultsStatementDisplay):
83    grok.view(ExportPDFClearanceSlipPage)
84
85class SecrCultsStatementUpload(FileUpload):
86    """Affidavit of Non-Membership of Secret Cults upload viewlet.
87    """
88    grok.order(20)
89    label = _(u'Affidavit of Non-Membership of Secret Cults')
90    title = _(u'Affidavit of Non-Membership of Secret Cults Scan')
91    mus = 1024 * 150
92    download_name = u'secr_cults'
93
94class ResultStatementImage(Image):
95    """Renders Affidavit of Non-Membership of Secret Cults scan.
96    """
97    grok.name('secr_cults')
98    download_name = u'secr_cults'
Note: See TracBrowser for help on using the repository browser.