Ignore:
Timestamp:
9 Jan 2010, 18:33:54 (15 years ago)
Author:
uli
Message:

Move LeftSidebarLink? to viewlets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-layout/src/waeup/browser/viewlets.py

    r4773 r4774  
    1515                              IDepartment, ICourse, ICertificate,
    1616                              ICertificateCourse, IDataCenter)
    17 from waeup.viewlets import LeftSidebar
    1817
    1918grok.templatedir('templates')
    2019grok.context(IWAeUPObject) # Make IWAeUPObject the default context
     20
     21class LeftSidebar(grok.ViewletManager):
     22    grok.name('left')
    2123
    2224class BreadCrumbManager(grok.ViewletManager):
     
    6264        # We cannot simply replace local sites.
    6365        self.can_import = not ISite.providedBy(self.context)
     66
     67class 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
    6489
    6590           
Note: See TracChangeset for help on using the changeset viewer.