web/views/tableview.py
branchstable
changeset 3807 8ae53322ffcc
parent 3689 deb13e88e037
child 3842 66f3ed1703d0
equal deleted inserted replaced
3806:6a4191b0eb9a 3807:8ae53322ffcc
    13 from logilab.mtconverter import xml_escape
    13 from logilab.mtconverter import xml_escape
    14 
    14 
    15 from cubicweb.selectors import nonempty_rset, match_form_params
    15 from cubicweb.selectors import nonempty_rset, match_form_params
    16 from cubicweb.utils import make_uid
    16 from cubicweb.utils import make_uid
    17 from cubicweb.view import EntityView, AnyRsetView
    17 from cubicweb.view import EntityView, AnyRsetView
       
    18 from cubicweb.common import tags
    18 from cubicweb.common.uilib import toggle_action, limitsize, htmlescape
    19 from cubicweb.common.uilib import toggle_action, limitsize, htmlescape
    19 from cubicweb.web import jsonize
    20 from cubicweb.web import jsonize
    20 from cubicweb.web.htmlwidgets import (TableWidget, TableColumn, MenuWidget,
    21 from cubicweb.web.htmlwidgets import (TableWidget, TableColumn, MenuWidget,
    21                                       PopupBoxMenu, BoxLink)
    22                                       PopupBoxMenu, BoxLink)
    22 from cubicweb.web.facet import prepare_facets_rqlst, filter_hiddens
    23 from cubicweb.web.facet import prepare_facets_rqlst, filter_hiddens
   178         return [(showhide, showlabel, None, '%sShow' % divid),
   179         return [(showhide, showlabel, None, '%sShow' % divid),
   179                 (showhide, hidelabel, 'hidden', '%sHide' % divid)]
   180                 (showhide, hidelabel, 'hidden', '%sHide' % divid)]
   180 
   181 
   181     def render_actions(self, divid, actions):
   182     def render_actions(self, divid, actions):
   182         box = MenuWidget('', 'tableActionsBox', _class='', islist=False)
   183         box = MenuWidget('', 'tableActionsBox', _class='', islist=False)
   183         label = '<img src="%s" alt="%s"/>' % (
   184         label = tags.img(src=self.req.external_resource('PUCE_UP'),
   184             self.req.datadir_url + 'liveclipboard-icon.png',
   185                          alt=xml_escape(self.req._('action(s) on this selection')))
   185             xml_escape(self.req._('action(s) on this selection')))
       
   186         menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox',
   186         menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox',
   187                             ident='%sActions' % divid)
   187                             ident='%sActions' % divid)
   188         box.append(menu)
   188         box.append(menu)
   189         for url, label, klass, ident in actions:
   189         for url, label, klass, ident in actions:
   190             menu.append(BoxLink(url, label, klass, ident=ident, escape=True))
   190             menu.append(BoxLink(url, label, klass, ident=ident, escape=True))