minor extensions on layout views

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3280 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-03-15 13:50:56 +00:00
parent 8dfdf85403
commit 77950fbf0f
3 changed files with 23 additions and 1 deletions

View file

@ -8,11 +8,15 @@ $Id$
New features
- new action: ``create task``
- quick search field
- external file/media asset type: options for hiding or showing fields on editing
- tracking reports: period details
- loops sites: a query view (``loops_sites.html``); add an option
``system.sites:/...,...`` with the paths to the sites that should be
listed; only sites are listed to which the user has access
- work items (work in progress): activate by adding option
- TaskView with task work items listing
- work items: activate by adding option
``action.portlet:createWorkitem`` to type; work items listing is shown
automatically in standard concept view.
- my work items: a query view (``userworkitems.html``); assign the query
@ -20,6 +24,7 @@ New features
Bug fixes
- relations: store relation objects explicitly in relation registry
- external collection: now works correctly (without creating empty files
in the var directory); resource type of generated object controlled by
mime type; automatically executes transformation steps on media assets

View file

@ -24,6 +24,7 @@ $Id$
import re
from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope import component
from zope.cachedescriptors.property import Lazy
from zope.proxy import removeAllProxies
@ -61,6 +62,10 @@ class BaseView(object):
return '%s/.%s-%s' % (absoluteURL(self.menu, self.request),
self.context.uid, normalize(self.context.title))
@Lazy
def authenticated(self):
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
def requireDojo(self, *packages):
# TODO: make sure dojo and dojo_require are displayed in page.js
djInfo = self.request.annotations.setdefault('ajax.dojo', {})

View file

@ -22,6 +22,7 @@ Layout node views.
$Id$
"""
from zope.app.security.interfaces import IUnauthenticatedPrincipal
from zope.cachedescriptors.property import Lazy
from cybertools.composer.layout.browser.view import Page
@ -38,6 +39,14 @@ class LayoutNodeView(Page):
def defaultPredicate(self):
return self.loopsRoot.getConceptManager().getDefaultPredicate()
@Lazy
def conceptManager(self):
return self.loopsRoot.getConceptManager()
@Lazy
def defaultPredicate(self):
return self.conceptManager.getDefaultPredicate()
@Lazy
def layoutName(self):
return self.context.viewName or 'page'
@ -71,3 +80,6 @@ class LayoutNodeView(Page):
else:
return self.context.title
@Lazy
def authenticated(self):
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)