From 77950fbf0f3aae16601ef6ca5274863b7e458fb8 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 15 Mar 2009 13:50:56 +0000 Subject: [PATCH] minor extensions on layout views git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3280 fd906abe-77d9-0310-91a1-e0d9ade77398 --- CHANGES.txt | 7 ++++++- layout/browser/base.py | 5 +++++ layout/browser/node.py | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ba80bf0..ffa33bb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/layout/browser/base.py b/layout/browser/base.py index 2c25214..ce2ed3c 100644 --- a/layout/browser/base.py +++ b/layout/browser/base.py @@ -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', {}) diff --git a/layout/browser/node.py b/layout/browser/node.py index 6ab6feb..bf44197 100644 --- a/layout/browser/node.py +++ b/layout/browser/node.py @@ -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)