source: main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/students/viewlets.py @ 11476

Last change on this file since 11476 was 10818, checked in by Henrik Bettermann, 11 years ago

Customize MyStudentDataTab?.

  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[10770]1## $Id: viewlets.py 10818 2013-11-29 11:35:34Z 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
[10818]19import grok
20from zope.component import getUtility
21from waeup.kofa.interfaces import IExtFileStore
22
[10804]23from waeup.kofa.students.viewlets import (
24    StudentsTab, AdmissionSlipActionButton, StudentManageClearanceLink,
[10812]25    StudentManagePersonalLink, StudentManageAccommodationLink,
26    AddBalancePaymentActionButton,
[10818]27    AddPreviousPaymentActionButton,
28    MyStudentDataTab)
[10770]29
[10772]30from kofacustom.ekodisco.interfaces import MessageFactory as _
31
32
[10804]33class AdmissionSlipActionButton(AdmissionSlipActionButton):
34    target = ''
35
36class StudentManageClearanceLink(StudentManageClearanceLink):
37    link = ''
38
39class CustomStudentManagePersonalLink(StudentManagePersonalLink):
40    link = ''
41
42class CustomStudentManageAccommodationLink(StudentManageAccommodationLink):
43    link = ''
[10812]44
45class CustomAddBalancePaymentActionButton(AddBalancePaymentActionButton):
46    target = ''
47
48class CustomAddPreviousPaymentActionButton(AddPreviousPaymentActionButton):
49    target = ''
[10818]50
51class CustomMyStudentDataTab(MyStudentDataTab):
52    """MyData dropdown tab in primary navigation.
53    """
54
55    @property
56    def targets(self):
57        student = grok.getSite()['students'][self.request.principal.id]
58        student_url = self.view.url(student)
59        app_slip = getUtility(IExtFileStore).getFileByContext(
60            student, 'application_slip')
61        targets = []
62        if app_slip:
63            targets = [{'url':student_url + '/application_slip',
64                        'title':_('Subscription Slip')},]
65        targets += [
66            {'url':student_url, 'title':'Base Data'},
67            {'url':student_url + '/studycourse', 'title':_('Main Contract')},
68            {'url':student_url + '/payments', 'title':_('Payments')},
69            {'url':student_url + '/history', 'title':_('History')},
70            ]
71        return targets
Note: See TracBrowser for help on using the repository browser.