- Timestamp:
- 26 Jan 2009, 15:15:29 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/university/facultycontainer.py
r3878 r3884 5 5 from waeup.basecontainer import BaseContainer 6 6 from waeup.interfaces import IFacultyContainer 7 from waeup.viewlets import MainArea, Index, Add7 from waeup.viewlets import MainArea, LeftSidebar, Index, Add 8 8 from interfaces import IFaculty 9 9 from faculty import Faculty … … 14 14 15 15 grok.implements(IFacultyContainer) 16 grok.require('waeup.manageUniversity') 16 17 17 18 name = u'Faculties' 18 19 19 20 def getId(self, faculty): 20 21 """We need a unified id for each faculty, which acts as key. … … 54 55 grok.context(IFacultyContainer) 55 56 form_fields = grok.AutoFields(IFaculty) 57 label = 'Add a faculty' 56 58 57 59 @grok.action('Add faculty') … … 95 97 pass 96 98 return result 99 100 class AddFacultyLink(grok.Viewlet): 101 """A link in the left sidebar displaying 'Add faculty' 102 """ 103 grok.viewletmanager(LeftSidebar) 104 grok.context(IFacultyContainer) 105 grok.view(Index) 106 grok.order(5) 107 # This is so cool! This link is only displayed, when the user is 108 # allowed to use it! 109 grok.require('waeup.manageUniversity') 110 111 def render(self): 112 return u'<div class="portlet"><a href="add">Add faculty</a></div>'
Note: See TracChangeset for help on using the changeset viewer.