source: main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py @ 6682

Last change on this file since 6682 was 6660, checked in by Henrik Bettermann, 13 years ago

Add permission waeup.handleStudent and local role StudentRecordOwner? for students.

Change permission name from waeup.viewStudents to waeup.viewStudent. This permission can be applied to one student (by assigning the role StudentRecordOwner?) in contrast to waeup.manageStudents which will only be applicable to a group of students.

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1import grok
2from zope.interface import Interface
3from waeup.sirp.interfaces import IWAeUPObject
4
5grok.context(IWAeUPObject) # Make IWAeUPObject the default context
6
7class StudentSidebar(grok.ViewletManager):
8    grok.name('left_student')
9
10class StudentLink(grok.Viewlet):
11    """A link displayed in the student box which shows up for StudentNavigation
12    objects.
13
14    """
15    grok.baseclass()
16    grok.viewletmanager(StudentSidebar)
17    grok.context(IWAeUPObject)
18    grok.view(Interface)
19    grok.order(5)
20    grok.require('waeup.viewStudent')
21
22    link = 'index'
23    text = u'Base Data'
24
25    def render(self):
26        url = self.view.url(self.context.getStudent(), self.link)
27        return u'<div class="portlet"><a href="%s">%s</a></div>' % (
28                url, self.text)
29
30class StudentBaseLink(StudentLink):
31    grok.order(1)
32    link = 'index'
33    text = u'Base Data'
34
35class StudentClearanceLink(StudentLink):
36    grok.order(2)
37    link = 'view_clearance'
38    text = u'Clearance Data'
39
40class StudentPersonalLink(StudentLink):
41    grok.order(2)
42    link = 'view_personal'
43    text = u'Personal Data'
44
45class StudentStudyCourseLink(StudentLink):
46    grok.order(3)
47    link = 'studycourse'
48    text = u'Study Course'
49
50class StudentPaymentsLink(StudentLink):
51    grok.order(4)
52    link = 'payments'
53    text = u'Payments'
54
55class StudentAccommodationLink(StudentLink):
56    grok.order(5)
57    link = 'accommodation'
58    text = u'Accommodation Data'
59
60class StudentHistoryLink(StudentLink):
61    grok.order(6)
62    link = 'history'
63    text = u'History'
Note: See TracBrowser for help on using the repository browser.