Changeset 4774 for waeup/branches/ulif-layout/src/waeup/browser/viewlets.py
- Timestamp:
- 9 Jan 2010, 18:33:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/browser/viewlets.py
r4773 r4774 15 15 IDepartment, ICourse, ICertificate, 16 16 ICertificateCourse, IDataCenter) 17 from waeup.viewlets import LeftSidebar18 17 19 18 grok.templatedir('templates') 20 19 grok.context(IWAeUPObject) # Make IWAeUPObject the default context 20 21 class LeftSidebar(grok.ViewletManager): 22 grok.name('left') 21 23 22 24 class BreadCrumbManager(grok.ViewletManager): … … 62 64 # We cannot simply replace local sites. 63 65 self.can_import = not ISite.providedBy(self.context) 66 67 class LeftSidebarLink(grok.Viewlet): 68 """ An entry on left sidebar. 69 70 This is only a baseclass that won't be rendered actually. Deriving 71 viewlets can override certain values and will be rendered with the 72 values set here as default. 73 """ 74 grok.baseclass() 75 grok.viewletmanager(LeftSidebar) 76 grok.context(IWAeUPObject) 77 grok.order(5) 78 grok.require('waeup.manageUniversity') 79 80 title = 'Text of link' 81 @property 82 def url(self): 83 return 'URL to link to' 84 85 def render(self): 86 return u'<div class="portlet"><a href="%s">%s</a></div>' % ( 87 self.url, self.title) 88 64 89 65 90
Note: See TracChangeset for help on using the changeset viewer.