web/box.py
brancholdstable
changeset 5993 50e1a6ad3e98
parent 5426 0d4853a6e5ee
child 5927 654a34e4eb2e
equal deleted inserted replaced
5487:3ab2682a4b37 5993:50e1a6ad3e98
    23 
    23 
    24 from logilab.mtconverter import xml_escape
    24 from logilab.mtconverter import xml_escape
    25 
    25 
    26 from cubicweb import Unauthorized, role as get_role, target as get_target
    26 from cubicweb import Unauthorized, role as get_role, target as get_target
    27 from cubicweb.schema import display_name
    27 from cubicweb.schema import display_name
    28 from cubicweb.selectors import (one_line_rset,  primary_view,
    28 from cubicweb.selectors import (no_cnx, one_line_rset,  primary_view,
    29                                 match_context_prop, partial_has_related_entities)
    29                                 match_context_prop, partial_has_related_entities)
    30 from cubicweb.view import View, ReloadableMixIn
    30 from cubicweb.view import View, ReloadableMixIn
    31 
    31 
    32 from cubicweb.web import INTERNAL_FIELD_VALUE
    32 from cubicweb.web import INTERNAL_FIELD_VALUE
    33 from cubicweb.web.htmlwidgets import (BoxLink, BoxWidget, SideBoxWidget,
    33 from cubicweb.web.htmlwidgets import (BoxLink, BoxWidget, SideBoxWidget,
    48     to fetch desired actions, and then to do something like  ::
    48     to fetch desired actions, and then to do something like  ::
    49 
    49 
    50         box.render(self.w)
    50         box.render(self.w)
    51     """
    51     """
    52     __registry__ = 'boxes'
    52     __registry__ = 'boxes'
    53     __select__ = match_context_prop()
    53     __select__ = ~no_cnx() & match_context_prop()
    54 
    54 
    55     categories_in_order = ()
    55     categories_in_order = ()
    56     cw_property_defs = {
    56     cw_property_defs = {
    57         _('visible'): dict(type='Boolean', default=True,
    57         _('visible'): dict(type='Boolean', default=True,
    58                            help=_('display the box or not')),
    58                            help=_('display the box or not')),