extend/improve ajax/innerHtml stuff

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1293 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-08-08 18:59:21 +00:00
parent a7665fc8ff
commit 65a605ad48
5 changed files with 46 additions and 6 deletions

View file

@ -1,3 +1,28 @@
#
# Copyright (c) 2006 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
$Id$
"""
from zope.app.pagetemplate import ViewPageTemplateFile
from zope.formlib.namedtemplate import NamedTemplateImplementation
innerHtml = NamedTemplateImplementation(
ViewPageTemplateFile('innerHtml.pt'))

View file

@ -17,4 +17,19 @@
permission="zope.Public"
/>
<page
for="*"
name="ajax.inner.html"
template="../innerHtml.pt"
permission="zope.ManageContent"
menu="zmi_views" title="Contents"
/>
<!-- named template -->
<zope:adapter
factory="cybertools.ajax.innerHtml"
for="zope.publisher.interfaces.browser.IBrowserPublisher"
name="ajax.inner.html" />
</configure>

View file

@ -1,4 +1,4 @@
<tal:def define="macroName view/macroName;
tpl view/template;">
<tal:def define="macroName view/innerHtml_macro;
tpl nocall:view/innerHtml_template;">
<metal:use use-macro="tpl/macros/?macroName" />
</tal:def>
</tal:def>

View file

@ -38,10 +38,10 @@ class ContainerView(JustContents):
# informations for the ajax.inner.html view (template):
def template(self):
def innerHtml_template(self):
basicView = zapi.getMultiAdapter((self.context, self.request),
Interface, name=u'contents.html')
return basicView.index
macroName = 'contents'
innerHtml_macro = 'contents'

View file

@ -160,7 +160,7 @@
tal:condition="python: first != current">1</a>
<span tal:condition="python: first &lt; previous-1">...</span>
<a href="#"
tal:attributes="xhref batch/previous/url;
tal:attributes="href batch/previous/url;
onclick batch/previous/navOnClick"
tal:content="batch/previous/title"
tal:condition="python: first != previous and previous != current">2</a>