26 from cubicweb.utils import make_uid, json_dumps |
26 from cubicweb.utils import make_uid, json_dumps |
27 from cubicweb.view import EntityView, AnyRsetView |
27 from cubicweb.view import EntityView, AnyRsetView |
28 from cubicweb import tags |
28 from cubicweb import tags |
29 from cubicweb.uilib import toggle_action, limitsize, htmlescape |
29 from cubicweb.uilib import toggle_action, limitsize, htmlescape |
30 from cubicweb.web import jsonize |
30 from cubicweb.web import jsonize |
|
31 from cubicweb.web.component import Link |
31 from cubicweb.web.htmlwidgets import (TableWidget, TableColumn, MenuWidget, |
32 from cubicweb.web.htmlwidgets import (TableWidget, TableColumn, MenuWidget, |
32 PopupBoxMenu, BoxLink) |
33 PopupBoxMenu) |
33 from cubicweb.web.facet import prepare_facets_rqlst, filter_hiddens |
34 from cubicweb.web.facet import prepare_facets_rqlst, filter_hiddens |
34 |
35 |
35 class TableView(AnyRsetView): |
36 class TableView(AnyRsetView): |
36 """The table view accepts any non-empty rset. It uses |
37 """The table view accepts any non-empty rset. It uses |
37 introspection on the result set to compute column names and the |
38 introspection on the result set to compute column names and the |
210 alt=xml_escape(self._cw._('action(s) on this selection'))) |
211 alt=xml_escape(self._cw._('action(s) on this selection'))) |
211 menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox', |
212 menu = PopupBoxMenu(label, isitem=False, link_class='actionsBox', |
212 ident='%sActions' % divid) |
213 ident='%sActions' % divid) |
213 box.append(menu) |
214 box.append(menu) |
214 for url, label, klass, ident in actions: |
215 for url, label, klass, ident in actions: |
215 menu.append(BoxLink(url, label, klass, ident=ident, escape=True)) |
216 menu.append(Link(url, label, klass=klass, id=ident)) |
216 box.render(w=self.w) |
217 box.render(w=self.w) |
217 self.w(u'<div class="clear"/>') |
218 self.w(u'<div class="clear"/>') |
218 |
219 |
219 def get_columns(self, computed_labels, displaycols, headers, subvid, |
220 def get_columns(self, computed_labels, displaycols, headers, subvid, |
220 cellvids, cellattrs, mainindex): |
221 cellvids, cellattrs, mainindex): |