provide check for authenticated on base view; minor CSS improvements

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3338 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-04-20 06:37:45 +00:00
parent c5d872df6c
commit 647ed44cee
4 changed files with 9 additions and 4 deletions

View file

@ -37,7 +37,8 @@
</metal:content>
</div>
<div id="sub-section" metal:define-macro="sub-section">
<div id="sub-section"
tal:condition="view/isAuthenticated">
<tal:portlet repeat="macro controller/macros/portlet_right">
<metal:portlet use-macro="macro" />
</tal:portlet>

View file

@ -7,7 +7,7 @@
margin: 4em;
}
.top, #header, #menu, #sub-section, #footer, .object-actions {
.top, #header, #menu, #sub-section, #footer, .object-actions, .button {
display: none;
}

View file

@ -3,7 +3,7 @@
*/
.top, #header, #menu, #sub-section, #footer, .object-actions {
.top, #header, #menu, #sub-section, #footer, .object-actions, .button {
display: none;
}
@ -11,4 +11,3 @@
width: 100%;
color: Black;
}

View file

@ -27,6 +27,7 @@ from zope.interface import Interface, implements
from zope.cachedescriptors.property import Lazy
from zope.publisher.interfaces.browser import IBrowserSkinType
from zope.app.pagetemplate import ViewPageTemplateFile
from zope.app.security.interfaces import IUnauthenticatedPrincipal
mainTemplate = ViewPageTemplateFile('main.pt')
@ -84,6 +85,10 @@ class GenericView(object):
# this is useful for a top-level page only
return self.index(*args, **kw)
@Lazy
def isAuthenticated(self):
return not IUnauthenticatedPrincipal.providedBy(self.request.principal)
def setupSubviews(self):
pass