have navigation on top and bottom of search results
authorArthur Lutz <arthur.lutz@logilab.fr>
Tue, 10 Feb 2009 18:12:10 +0100
changeset 592 aae01d81c713
parent 591 9eeb3d0a4463
child 593 6f6549780096
have navigation on top and bottom of search results
web/views/basetemplates.py
--- a/web/views/basetemplates.py	Tue Feb 10 17:27:25 2009 +0100
+++ b/web/views/basetemplates.py	Tue Feb 10 18:12:10 2009 +0100
@@ -7,6 +7,8 @@
 """
 __docformat__ = "restructuredtext en"
 
+from StringIO import StringIO
+
 from logilab.mtconverter import html_escape
 
 from cubicweb import NoSelectableObject, ObjectNotFound
@@ -114,6 +116,7 @@
     def call(self):
         view, rset = self._select_view_and_rset()
         req = self.req
+        self.nav_html = StringIO()
         # update breadcrumps **before** validating cache, unless the view
         # specifies explicitly it should not be added to breadcrumb or the
         # view is a binary view
@@ -162,7 +165,9 @@
                                                  self.req, self.rset)
         if etypefilter and etypefilter.propval('visible'):
             etypefilter.dispatch(w=self.w)
-        self.pagination(self.req, self.rset, self.w, not (view and view.need_navigation))
+        self.pagination(self.req, self.rset, self.nav_html.write,
+                        not (view and view.need_navigation))
+        self.w(_(self.nav_html.getvalue()))
         self.w(u'<div id="contentmain">\n')
     
     def template_html_header(self, content_type, page_title, additional_headers=()):
@@ -198,6 +203,7 @@
             
     def template_footer(self, view=None):
         self.w(u'</div>\n') # close id=contentmain
+        self.w(_(self.nav_html.getvalue()))
         self.w(u'</div>\n') # closes id=pageContent
         self.content_footer(view)
         self.w(u'</td>\n')