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 -->
|
||||
|
||||
<page for="loops.interfaces.INode"
|
||||
<!--<page for="loops.interfaces.INode"
|
||||
name="login.html"
|
||||
class="loops.browser.auth.LoginForm"
|
||||
permission="zope.View" />
|
||||
permission="zope.View" />-->
|
||||
|
||||
<page for="loops.interfaces.INode"
|
||||
name="logout.html"
|
||||
|
@ -539,13 +539,13 @@
|
|||
|
||||
<!-- query views -->
|
||||
|
||||
<zope:adapter
|
||||
<!--<zope:adapter
|
||||
name="login.html"
|
||||
for="loops.interfaces.IConcept
|
||||
zope.publisher.interfaces.browser.IBrowserRequest"
|
||||
provides="zope.interface.Interface"
|
||||
factory="loops.browser.auth.LoginConcept"
|
||||
permission="zope.View" />
|
||||
permission="zope.View" />-->
|
||||
|
||||
<zope:adapter
|
||||
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
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -20,6 +20,7 @@
|
|||
View class for Node objects.
|
||||
"""
|
||||
|
||||
import urllib
|
||||
from urlparse import urlparse, urlunparse
|
||||
from zope import component, interface, schema
|
||||
from zope.cachedescriptors.property import Lazy
|
||||
|
@ -418,6 +419,15 @@ class NodeView(BaseView):
|
|||
def active(self, item):
|
||||
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
|
||||
|
||||
@Lazy
|
||||
|
|
|
@ -327,8 +327,7 @@
|
|||
|
||||
|
||||
<metal:actions define-macro="personal">
|
||||
<div><a href="logout.html?nextURL=login.html"
|
||||
tal:attributes="href string:logout.html?nextURL=${view/menu/url}"
|
||||
<div><a tal:attributes="href view/logoutUrl"
|
||||
i18n:translate="">Log out</a></div>
|
||||
<tal:actions repeat="action python:view.getAllowedActions('personal')">
|
||||
<metal:action use-macro="action/macro" />
|
||||
|
|
Loading…
Add table
Reference in a new issue