# HG changeset patch # User Aurelien Campeas # Date 1236089163 -3600 # Node ID 999198995a530f6c64aa7a77619a2aa7150b5d64 # Parent 98f19cf755a146a69a3f6de3dd9f3f236c7039ce# Parent 9c6ce9d6384f77d0bc60d5ec8a5fb37eb810735a merge treeview-tabs into default (for 3.1.1) diff -r 98f19cf755a1 -r 999198995a53 web/views/tabs.py --- a/web/views/tabs.py Mon Mar 02 14:31:40 2009 +0100 +++ b/web/views/tabs.py Tue Mar 03 15:06:03 2009 +0100 @@ -1,7 +1,7 @@ """base classes to handle tabbed views :organization: Logilab -:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ @@ -90,6 +90,11 @@ self.req.add_css('ui.tabs.css') self.req.add_js(('ui.core.js', 'ui.tabs.js', 'cubicweb.ajax.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js')) + # tabbed views do no support concatenation + # hence we delegate to the default tab + if self.req.form.get('vid') == 'primary': + entity.view(default) + return # prune tabs : not all are to be shown tabs = self.prune_tabs(tabs) # select a tab diff -r 98f19cf755a1 -r 999198995a53 web/views/treeview.py --- a/web/views/treeview.py Mon Mar 02 14:31:40 2009 +0100 +++ b/web/views/treeview.py Tue Mar 03 15:06:03 2009 +0100 @@ -1,10 +1,19 @@ +"""Set of tree-building widgets, based on jQuery treeview plugin + +:organization: Logilab +:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr +""" +__docformat__ = "restructuredtext en" +import uuid + from logilab.mtconverter import html_escape - from cubicweb.interfaces import ITree from cubicweb.common.selectors import implement_interface, yes from cubicweb.common.view import EntityView -from cubicweb.web.views.baseviews import OneLineView +def treecookiename(treeid): + return str('treestate-%s' % treeid) class TreeView(EntityView): id = 'treeview' @@ -12,27 +21,30 @@ itemvid = 'treeitemview' css_classes = 'treeview widget' title = _('tree view') - - def call(self, subvid=None): - if subvid is None and 'subvid' in self.req.form: - subvid = self.req.form.pop('subvid') # consume it + + def call(self, subvid=None, treeid=None, initial_load=True): if subvid is None: - subvid = 'oneline' - self.req.add_css('jquery.treeview.css') - self.req.add_js(('cubicweb.ajax.js', 'jquery.treeview.js', 'cubicweb.widgets.js')) - # XXX noautoload is a quick hack to avoid treeview to be rebuilt - # after a json query and avoid double toggling bugs. - # Need to find a way to do that cleanly. - if 'noautoload' in self.req.form: - self.w(u'