Changeset 4774 for waeup/branches/ulif-layout
- Timestamp:
- 9 Jan 2010, 18:33:54 (15 years ago)
- Location:
- waeup/branches/ulif-layout/src/waeup/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/browser/__init__.py
r4757 r4774 1 1 from waeup.browser.layout import (WAeUPPage, WAeUPLayout, WAeUPDisplayFormPage, 2 2 WAeUPEditFormPage, WAeUPAddFormPage, 3 LeftSidebarLink,NullValidator)3 NullValidator) -
waeup/branches/ulif-layout/src/waeup/browser/layout.py
r4756 r4774 5 5 from megrok.layout import Page, Layout, EditForm, DisplayForm, AddForm 6 6 from waeup.interfaces import IWAeUPObject 7 from waeup.viewlets import LeftSidebar8 7 from z3c.flashmessage.interfaces import IMessageSource 9 8 from zope.component import queryUtility, ComponentLookupError … … 82 81 grok.baseclass() 83 82 84 class LeftSidebarLink(grok.Viewlet):85 """ An entry on left sidebar.86 87 This is only a baseclass that won't be rendered actually. Deriving88 viewlets can override certain values and will be rendered with the89 values set here as default.90 """91 grok.baseclass()92 grok.viewletmanager(LeftSidebar)93 grok.context(Interface)94 grok.order(5)95 grok.require('waeup.manageUniversity')96 97 title = 'Text of link'98 @property99 def url(self):100 return 'URL to link to'101 102 def render(self):103 return u'<div class="portlet"><a href="%s">%s</a></div>' % (104 self.url, self.title)105 106 83 class SiteLayout(WAeUPLayout): 107 84 """ The general site layout. -
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.