import grok from zope.interface import Interface from waeup.sirp.interfaces import IWAeUPObject grok.context(IWAeUPObject) # Make IWAeUPObject the default context class StudentSidebar(grok.ViewletManager): grok.name('left_student') class StudentLink(grok.Viewlet): """A link displayed in the student box which shows up for StudentNavigation objects. """ grok.baseclass() grok.viewletmanager(StudentSidebar) grok.context(IWAeUPObject) grok.view(Interface) grok.order(5) grok.require('waeup.viewStudent') link = 'index' text = u'Base Data' def render(self): url = self.view.url(self.context.getStudent(), self.link) return u'
%s
' % ( url, self.text) class StudentBaseLink(StudentLink): grok.order(1) link = 'index' text = u'Base Data' class StudentClearanceLink(StudentLink): grok.order(2) link = 'view_clearance' text = u'Clearance Data' class StudentPersonalLink(StudentLink): grok.order(2) link = 'view_personal' text = u'Personal Data' class StudentStudyCourseLink(StudentLink): grok.order(3) link = 'studycourse' text = u'Study Course' class StudentPaymentsLink(StudentLink): grok.order(4) link = 'payments' text = u'Payments' class StudentAccommodationLink(StudentLink): grok.order(5) link = 'accommodation' text = u'Accommodation Data' class StudentHistoryLink(StudentLink): grok.order(6) link = 'history' text = u'History'