diff -r 0c111b232927 -r 88c71ad83d47 web/views/boxes.py --- a/web/views/boxes.py Wed Aug 01 10:30:48 2012 +0200 +++ b/web/views/boxes.py Thu Mar 21 18:13:31 2013 +0100 @@ -36,7 +36,7 @@ from logilab.common.deprecation import class_deprecated from cubicweb import Unauthorized -from cubicweb.selectors import (match_user_groups, match_kwargs, +from cubicweb.predicates import (match_user_groups, match_kwargs, non_final_entity, nonempty_rset, match_context, contextual) from cubicweb.utils import wrap_on_write @@ -48,17 +48,17 @@ BoxTemplate = box.BoxTemplate BoxHtml = htmlwidgets.BoxHtml -class EditBox(component.CtxComponent): # XXX rename to ActionsBox +class EditBox(component.CtxComponent): """ box with all actions impacting the entity displayed: edit, copy, delete change state, add related entities... """ __regid__ = 'edit_box' - __select__ = component.CtxComponent.__select__ & non_final_entity() title = _('actions') order = 2 contextual = True + __select__ = component.CtxComponent.__select__ & non_final_entity() def init_rendering(self): super(EditBox, self).init_rendering() @@ -136,13 +136,13 @@ title = _('search') order = 0 - formdef = u"""
-
- + formdef = u""" +
+ - +
""" @@ -155,8 +155,13 @@ rql = self._cw.form.get('rql', '') else: rql = '' - w(self.formdef % (self._cw.build_url('view'), self._cw.next_tabindex(), - xml_escape(rql), self._cw.next_tabindex())) + tabidx1 = self._cw.next_tabindex() + tabidx2 = self._cw.next_tabindex() + w(self.formdef % {'action': self._cw.build_url('view'), + 'value': xml_escape(rql), + 'id': self.cw_extra_kwargs.get('domid', 'tsearch'), + 'tabindex1': tabidx1, + 'tabindex2': tabidx2}) # boxes disabled by default ###################################################