web/views/treeview.py
author sylvain.thenault@logilab.fr
Thu, 12 Mar 2009 16:33:47 +0100
branchtls-sprint
changeset 1096 e1fe98850bf7
parent 1007 34e92a8d9167
child 1133 8a409ea0c9ec
permissions -rw-r--r--
cleanup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
928
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     1
"""Set of tree-building widgets, based on jQuery treeview plugin
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     2
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     3
:organization: Logilab
1007
34e92a8d9167 typo, don't give treeid as argument to treeitemview (XXX auc?)
sylvain.thenault@logilab.fr
parents: 1006
diff changeset
     4
:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
928
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     6
"""
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     7
__docformat__ = "restructuredtext en"
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
     8
981
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
     9
from logilab.common.decorators import monkeypatch
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
from logilab.mtconverter import html_escape
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    11
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
from cubicweb.interfaces import ITree
981
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
    13
from cubicweb.selectors import implements
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
    14
from cubicweb.view import EntityView
1007
34e92a8d9167 typo, don't give treeid as argument to treeitemview (XXX auc?)
sylvain.thenault@logilab.fr
parents: 1006
diff changeset
    15
from cubicweb.utils import make_uid
981
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
    16
from cubicweb.web.views.basecontrollers import JSonController
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    17
928
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    18
def treecookiename(treeid):
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    19
    return str('treestate-%s' % treeid)
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    20
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    22
from cubicweb.web.views.baseviews import OneLineView
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    23
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    24
class TreeView(EntityView):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25
    id = 'treeview'
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    26
    itemvid = 'treeitemview'
443
3c0e9c1d645d cleanup
sylvain.thenault@logilab.fr
parents: 431
diff changeset
    27
    css_classes = 'treeview widget'
3c0e9c1d645d cleanup
sylvain.thenault@logilab.fr
parents: 431
diff changeset
    28
    title = _('tree view')
916
968f00dd9a24 [treeview] (in progress) use less magic, having something that now allows prepopulating a part of the tree
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 472
diff changeset
    29
931
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    30
    def call(self, subvid=None, treeid=None, initial_load=True):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
        if subvid is None:
998
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    32
            if 'subvid' in self.req.form:
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    33
                subvid = self.req.form.pop('subvid') # consume it
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    34
            else:
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    35
                subvid = 'oneline'
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    36
        if treeid is None:
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    37
            if 'treeid' in self.req.form:
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    38
                treeid = self.req.form.pop('treeid')
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    39
            else:
1001
7d0fccdb8125 [treeview] uuid is not available in the stdlib before python 2.5
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 999
diff changeset
    40
                treeid = make_uid('throw away uid')
998
9c6ce9d6384f [treeview] if the client is not interested in maintaining the tree state across page reloads, we must provide a treeid
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 931
diff changeset
    41
                self.warning('Tree state won\'t be properly restored after next reload')
931
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    42
        if initial_load:
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    43
            self.req.add_css('jquery.treeview.css')
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    44
            self.req.add_js(('cubicweb.ajax.js', 'jquery.treeview.js'))
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    45
            self.req.html_headers.add_onload(u"""
1006
92a0601b2523 backport default branch
sylvain.thenault@logilab.fr
parents: 985 1001
diff changeset
    46
jQuery("#tree-%s").treeview({toggle: toggleTree, prerendered: true});""" % treeid)
916
968f00dd9a24 [treeview] (in progress) use less magic, having something that now allows prepopulating a part of the tree
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 472
diff changeset
    47
        self.w(u'<ul id="tree-%s" class="%s">' % (treeid, self.css_classes))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
        for rowidx in xrange(len(self.rset)):
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    49
            self.wview(self.itemvid, self.rset, row=rowidx, col=0,
1007
34e92a8d9167 typo, don't give treeid as argument to treeitemview (XXX auc?)
sylvain.thenault@logilab.fr
parents: 1006
diff changeset
    50
                       vid=subvid, parentvid=self.id)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    51
        self.w(u'</ul>')
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    52
        
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    53
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    54
class FileTreeView(TreeView):
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    55
    """specific version of the treeview to display file trees
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    56
    """
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    57
    id = 'filetree'
443
3c0e9c1d645d cleanup
sylvain.thenault@logilab.fr
parents: 431
diff changeset
    58
    css_classes = 'treeview widget filetree'
3c0e9c1d645d cleanup
sylvain.thenault@logilab.fr
parents: 431
diff changeset
    59
    title = _('file tree view')
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    60
931
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    61
    def call(self, subvid=None, treeid=None, initial_load=True):
7b701df4dbef [treeview] don't readd stuff to the header, poslish css classes
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 930
diff changeset
    62
        super(FileTreeView, self).call(treeid=treeid, subvid='filetree-oneline', initial_load=initial_load)
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    63
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    64
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    65
443
3c0e9c1d645d cleanup
sylvain.thenault@logilab.fr
parents: 431
diff changeset
    66
class FileItemInnerView(EntityView):
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    67
    """inner view used by the TreeItemView instead of oneline view
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    68
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    69
    This view adds an enclosing <span> with some specific CSS classes
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    70
    around the oneline view. This is needed by the jquery treeview plugin.
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    71
    """
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    72
    id = 'filetree-oneline'
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    73
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    74
    def cell_call(self, row, col):
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    75
        entity = self.entity(row, col)
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    76
        if ITree.is_implemented_by(entity.__class__) and not entity.is_leaf():
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    77
            self.w(u'<div class="folder">%s</div>' % entity.view('oneline'))
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    78
        else:
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    79
            # XXX define specific CSS classes according to mime types
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    80
            self.w(u'<div class="file">%s</div>' % entity.view('oneline'))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    81
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    82
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    83
class DefaultTreeViewItemView(EntityView):
981
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
    84
    """default treeitem view for entities which don't implement ITree"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
    id = 'treeitemview'
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    86
    
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    87
    def cell_call(self, row, col, vid='oneline', parentvid='treeview'):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
        entity = self.entity(row, col)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    89
        itemview = self.view(vid, self.rset, row=row, col=col)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
        if row == len(self.rset) - 1:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
            self.w(u'<li class="last">%s</li>' % itemview)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
        else:
472
958805c342b6 xhtml compliance
sylvain.thenault@logilab.fr
parents: 465
diff changeset
    93
            self.w(u'<li>%s</li>' % itemview)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
928
57614f333dc6 [treeview] (in progress) treeid has to be produced from outside
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
    96
class TreeViewItemView(EntityView):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    97
    """specific treeitem view for entities which implement ITree
916
968f00dd9a24 [treeview] (in progress) use less magic, having something that now allows prepopulating a part of the tree
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 472
diff changeset
    98
981
d86d1ee3b60e fix some imports, update treeview for 3.2
sylvain.thenault@logilab.fr
parents: 939
diff changeset
    99
    (each item should be expandable if it's not a tree leaf)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   100
    """
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   101
    id = 'treeitemview'
1007
34e92a8d9167 typo, don't give treeid as argument to treeitemview (XXX auc?)
sylvain.thenault@logilab.fr
parents: 1006
diff changeset
   102
    __select__ = implements(ITree)
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   103
    
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
   104
    def cell_call(self, row, col, vid='oneline', parentvid='treeview'):
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
        entity = self.entity(row, col)
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   106
        cssclasses = []
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   107
        is_leaf = False
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   108
        if row == len(self.rset) - 1:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
            is_leaf = True
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   110
        if not hasattr(entity, 'is_leaf') or entity.is_leaf():
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   111
            if is_leaf : cssclasses.append('last')
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   112
            self.w(u'<li class="%s">' % u' '.join(cssclasses))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   113
        else:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   114
            rql = entity.children_rql() % {'x': entity.eid}
150
1190261a1f13 provide a specific version of treeview to display files and directories
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
   115
            url = html_escape(self.build_url('json', rql=rql, vid=parentvid,
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   116
                                             pageid=self.req.pageid,
187
cae87ca76f02 quick hack to fix treeview double toggling bug
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 150
diff changeset
   117
                                             subvid=vid,
cae87ca76f02 quick hack to fix treeview double toggling bug
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 150
diff changeset
   118
                                             noautoload=True))
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   119
            cssclasses.append('expandable')
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   120
            divclasses = ['hitarea expandable-hitarea']
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   121
            if is_leaf :
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   122
                cssclasses.append('lastExpandable')
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   123
                divclasses.append('lastExpandable-hitarea')
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   124
            self.w(u'<li cubicweb:loadurl="%s" class="%s">' % (url, u' '.join(cssclasses)))
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   125
            self.w(u'<div class="%s"> </div>' % u' '.join(divclasses))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   126
            # add empty <ul> because jquery's treeview plugin checks for
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
            # sublists presence
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   128
            self.w(u'<ul class="placeholder"><li>place holder</li></ul>')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   129
        self.wview(vid, self.rset, row=row, col=col)
923
7c184924d492 unwanted merge : Backed out changeset 4328bcbd748e
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 918
diff changeset
   130
        self.w(u'</li>')
918
19862a0e55a5 [treeview] (inprogress) minimally working state-remembering treeview
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 916
diff changeset
   131