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 |
177 return [(showhide, showlabel, None, '%sShow' % divid), |
178 return [(showhide, showlabel, None, '%sShow' % divid), |
178 (showhide, hidelabel, 'hidden', '%sHide' % divid)] |
179 (showhide, hidelabel, 'hidden', '%sHide' % divid)] |
179 |
180 |
180 def render_actions(self, divid, actions): |
181 def render_actions(self, divid, actions): |
181 box = MenuWidget('', 'tableActionsBox', _class='', islist=False) |
182 box = MenuWidget('', 'tableActionsBox', _class='', islist=False) |
182 label = '<img src="%s" alt="%s"/>' % ( |
183 label = tags.img(src=self._cw.external_resource('PUCE_DOWN'), |
183 self._cw.datadir_url + 'liveclipboard-icon.png', |
184 alt=xml_escape(self._cw._('action(s) on this selection'))) |
184 xml_escape(self._cw._('action(s) on this selection'))) |
|
185 menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox', |
185 menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox', |
186 ident='%sActions' % divid) |
186 ident='%sActions' % divid) |
187 box.append(menu) |
187 box.append(menu) |
188 for url, label, klass, ident in actions: |
188 for url, label, klass, ident in actions: |
189 menu.append(BoxLink(url, label, klass, ident=ident, escape=True)) |
189 menu.append(BoxLink(url, label, klass, ident=ident, escape=True)) |