move new 'view/requestUrl' to cybertools/browser

This commit is contained in:
Helmut Merz 2016-06-09 09:01:20 +02:00
parent 17eafd7895
commit a8f70fd498
2 changed files with 1 additions and 12 deletions

View file

@ -42,7 +42,6 @@ from zope.formlib.namedtemplate import NamedTemplate
from zope.interface import Interface, implements from zope.interface import Interface, implements
from zope.proxy import removeAllProxies from zope.proxy import removeAllProxies
from zope.publisher.browser import applySkin from zope.publisher.browser import applySkin
from zope.publisher.http import URLGetter as BaseURLGetter
from zope.publisher.interfaces.browser import IBrowserSkinType, IBrowserView from zope.publisher.interfaces.browser import IBrowserSkinType, IBrowserView
from zope import schema from zope import schema
from zope.schema.vocabulary import SimpleTerm from zope.schema.vocabulary import SimpleTerm
@ -188,12 +187,6 @@ class SortableMixin(object):
return '/@@/cybertools.icons/arrowup.gif' return '/@@/cybertools.icons/arrowup.gif'
class URLGetter(BaseURLGetter):
def __str__(self):
return self.__request.getURL().rstrip('/@@index.html')
class BaseView(GenericView, I18NView, SortableMixin): class BaseView(GenericView, I18NView, SortableMixin):
actions = {} actions = {}
@ -216,10 +209,6 @@ class BaseView(GenericView, I18NView, SortableMixin):
pass pass
saveRequest(request) saveRequest(request)
@property
def requestUrl(self):
return URLGetter(self.request)
def todayFormatted(self): def todayFormatted(self):
return formatDate(date.today(), 'date', 'short', return formatDate(date.today(), 'date', 'short',
self.languageInfo.language) self.languageInfo.language)

View file

@ -51,7 +51,7 @@
<h1 tal:define="tabview item/tabview|nothing" <h1 tal:define="tabview item/tabview|nothing"
tal:attributes="ondblclick item/openEditWindow"> tal:attributes="ondblclick item/openEditWindow">
<a tal:omit-tag="python: level > 1" <a tal:omit-tag="python: level > 1"
tal:attributes="href string:${request/URL}${item/urlParamString}" tal:attributes="href string:${view/requestUrl}${item/urlParamString}"
tal:content="item/title">Title</a> tal:content="item/title">Title</a>
<a title="Show tabular view" <a title="Show tabular view"
i18n:attributes="title" i18n:attributes="title"