Merge branch 'bbmaster' of ssh://git.cy55.de/home/git/loops into bbmaster
This commit is contained in:
commit
1f4d246994
3 changed files with 16 additions and 7 deletions
|
@ -34,10 +34,10 @@
|
||||||
|
|
||||||
<!-- login/logout -->
|
<!-- login/logout -->
|
||||||
|
|
||||||
<page for="loops.interfaces.INode"
|
<!--<page for="loops.interfaces.INode"
|
||||||
name="login.html"
|
name="login.html"
|
||||||
class="loops.browser.auth.LoginForm"
|
class="loops.browser.auth.LoginForm"
|
||||||
permission="zope.View" />
|
permission="zope.View" />-->
|
||||||
|
|
||||||
<page for="loops.interfaces.INode"
|
<page for="loops.interfaces.INode"
|
||||||
name="logout.html"
|
name="logout.html"
|
||||||
|
@ -539,13 +539,13 @@
|
||||||
|
|
||||||
<!-- query views -->
|
<!-- query views -->
|
||||||
|
|
||||||
<zope:adapter
|
<!--<zope:adapter
|
||||||
name="login.html"
|
name="login.html"
|
||||||
for="loops.interfaces.IConcept
|
for="loops.interfaces.IConcept
|
||||||
zope.publisher.interfaces.browser.IBrowserRequest"
|
zope.publisher.interfaces.browser.IBrowserRequest"
|
||||||
provides="zope.interface.Interface"
|
provides="zope.interface.Interface"
|
||||||
factory="loops.browser.auth.LoginConcept"
|
factory="loops.browser.auth.LoginConcept"
|
||||||
permission="zope.View" />
|
permission="zope.View" />-->
|
||||||
|
|
||||||
<zope:adapter
|
<zope:adapter
|
||||||
name="list_children.html"
|
name="list_children.html"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2015 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
View class for Node objects.
|
View class for Node objects.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import urllib
|
||||||
from urlparse import urlparse, urlunparse
|
from urlparse import urlparse, urlunparse
|
||||||
from zope import component, interface, schema
|
from zope import component, interface, schema
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
@ -418,6 +419,15 @@ class NodeView(BaseView):
|
||||||
def active(self, item):
|
def active(self, item):
|
||||||
return item.context == self.context or item.context in self.parents
|
return item.context == self.context or item.context in self.parents
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def logoutUrl(self):
|
||||||
|
nextUrl = urllib.urlencode(dict(nextUrl=self.menu.url))
|
||||||
|
return '%s/logout.html?%s' % (self.menu.url, nextUrl)
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def authenticationMethod(self):
|
||||||
|
return self.viewAnnotations.get('auth_method') or 'standard'
|
||||||
|
|
||||||
# virtual target support
|
# virtual target support
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
|
|
@ -327,8 +327,7 @@
|
||||||
|
|
||||||
|
|
||||||
<metal:actions define-macro="personal">
|
<metal:actions define-macro="personal">
|
||||||
<div><a href="logout.html?nextURL=login.html"
|
<div><a tal:attributes="href view/logoutUrl"
|
||||||
tal:attributes="href string:logout.html?nextURL=${view/menu/url}"
|
|
||||||
i18n:translate="">Log out</a></div>
|
i18n:translate="">Log out</a></div>
|
||||||
<tal:actions repeat="action python:view.getAllowedActions('personal')">
|
<tal:actions repeat="action python:view.getAllowedActions('personal')">
|
||||||
<metal:action use-macro="action/macro" />
|
<metal:action use-macro="action/macro" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue