web/views/tabs.py
changeset 545 73aab1d2a27a
parent 544 890e8d016d12
child 547 e6fed6e5f523
--- a/web/views/tabs.py	Fri Jan 30 17:01:15 2009 +0100
+++ b/web/views/tabs.py	Fri Jan 30 17:15:07 2009 +0100
@@ -18,12 +18,6 @@
 
 from cubicweb.web.views.basecontrollers import JSonController
 
-# the prepend hack only work for 1-level lazy views
-# a whole lot different thing must be done otherwise
-@monkeypatch(HTMLHead)
-def prepend_post_inline_script(self, content):
-    self.post_inlined_scripts.insert(0, content)
-
 
 class LazyViewMixin(object):
     """provides two convenience methods for the tab machinery
@@ -38,11 +32,12 @@
         """
         w = w or self.w
         self.req.add_js('cubicweb.lazy.js')
-        eid = eid or ''
+        urlparams = {'vid' : vid, 'mode' : 'html'}
+        if eid:
+            urlparams['rql'] = rql_for_eid(eid)
         # w(u'<div id="lazy-%s" cubicweb:loadurl="%s-%s">' % (vid, vid, eid))
         w(u'<div id="lazy-%s" cubicweb:loadurl="%s">' % (
-            vid, html_escape(self.build_url('json', rql=rql_for_eid(eid), vid=vid,
-                                            mode='html'))))
+            vid, html_escape(self.build_url('json', **urlparams))))
         if show_spinbox:
             w(u'<img src="data/loading.gif" id="%s-hole" alt="%s"/>'
               % (vid, self.req._('loading')))