[ajax] make navigation component appear both above and below the view (closes #2110266)
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 08 Dec 2011 14:30:00 +0100
changeset 8116 6510654269a6
parent 8114 8311cc3b472a
child 8119 29cdde6bb9ef
[ajax] make navigation component appear both above and below the view (closes #2110266)
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Thu Dec 08 13:17:25 2011 +0100
+++ b/web/views/basecontrollers.py	Thu Dec 08 14:30:00 2011 +0100
@@ -349,8 +349,10 @@
             if vtitle:
                 stream.write(u'<h1 class="vtitle">%s</h1>\n' % vtitle)
             paginate = True
+        nav_html = UStringIO()
         if paginate and not view.handle_pagination:
-            view.paginate()
+            view.paginate(w=nav_html.write)
+        stream.write(nav_html.getvalue())
         if divid == 'pageContent':
             stream.write(u'<div id="contentmain">')
         view.render(**kwargs)
@@ -360,7 +362,7 @@
             stream.write(extresources)
             stream.write(u'</div>\n')
         if divid == 'pageContent':
-            stream.write(u'</div></div>')
+            stream.write(u'</div>%s</div>' % nav_html.getvalue())
         return stream.getvalue()
 
     @xhtmlize