Changeset 3851 for waeup/branches
- Timestamp:
- 16 Jan 2009, 12:25:51 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/viewlets.py
r3530 r3851 2 2 import grok 3 3 import zope.interface 4 from interfaces import IUniversity 4 from interfaces import IUniversity, IWAeUPObject 5 5 6 6 grok.context(zope.interface.Interface) … … 10 10 grok.template('master') 11 11 12 def __init__(self, context, request):# 13 super(Index, self).__init__(context, request) 14 12 class Manage(grok.View): 13 """Admin view for waeup objects. 14 """ 15 grok.context(IWAeUPObject) 16 15 17 class Head(grok.ViewletManager): 16 18 """additions to HTML head""" … … 30 32 grok.order(1) 31 33 34 def getAppTitle(self): 35 """Get the `name` attribute of the local site object. 36 37 This is normally the waeup application or IUniversity object. 38 If this object has no ``name`` attribute, then we return the 39 empty string. 40 """ 41 app = grok.getSite() 42 return getattr(app, 'name', u'') 43 32 44 class NavigationBar(grok.Viewlet): 33 45 grok.viewletmanager(Header) … … 42 54 class AuthUser(grok.Viewlet): 43 55 grok.viewletmanager(LeftSidebar) 44 grok.view(Index)45 56 grok.order(1) 46 57 … … 51 62 grok.order(2) 52 63 64 def isAuthenticated(self): 65 """Is the calling user authenticated? 66 """ 67 return self.request.principal.id != 'zope.anybody' 68 53 69 class MainArea(grok.ViewletManager): 54 70 grok.name('main')
Note: See TracChangeset for help on using the changeset viewer.