web/box.py
changeset 10688 fa29f3628a1b
parent 10666 7f6b5f023884
child 10715 edd1ba9bb030
equal deleted inserted replaced
10687:d394bfcd8c25 10688:fa29f3628a1b
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """abstract box classes for CubicWeb web client"""
    18 """abstract box classes for CubicWeb web client"""
    19 
    19 
    20 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    21 from cubicweb import _
    21 from cubicweb import _
       
    22 
       
    23 from six import add_metaclass
    22 
    24 
    23 from logilab.mtconverter import xml_escape
    25 from logilab.mtconverter import xml_escape
    24 from logilab.common.deprecation import class_deprecated, class_renamed
    26 from logilab.common.deprecation import class_deprecated, class_renamed
    25 
    27 
    26 from cubicweb import Unauthorized, role as get_role
    28 from cubicweb import Unauthorized, role as get_role
    51     return result
    53     return result
    52 
    54 
    53 
    55 
    54 # old box system, deprecated ###################################################
    56 # old box system, deprecated ###################################################
    55 
    57 
       
    58 @add_metaclass(class_deprecated)
    56 class BoxTemplate(View):
    59 class BoxTemplate(View):
    57     """base template for boxes, usually a (contextual) list of possible
    60     """base template for boxes, usually a (contextual) list of possible
    58     actions. Various classes attributes may be used to control the box
    61     actions. Various classes attributes may be used to control the box
    59     rendering.
    62     rendering.
    60 
    63 
    64     Classes inheriting from this class usually only have to override call
    67     Classes inheriting from this class usually only have to override call
    65     to fetch desired actions, and then to do something like  ::
    68     to fetch desired actions, and then to do something like  ::
    66 
    69 
    67         box.render(self.w)
    70         box.render(self.w)
    68     """
    71     """
    69     __metaclass__ = class_deprecated
       
    70     __deprecation_warning__ = '[3.10] *BoxTemplate classes are deprecated, use *CtxComponent instead (%(cls)s)'
    72     __deprecation_warning__ = '[3.10] *BoxTemplate classes are deprecated, use *CtxComponent instead (%(cls)s)'
    71 
    73 
    72     __registry__ = 'ctxcomponents'
    74     __registry__ = 'ctxcomponents'
    73     __select__ = ~no_cnx()
    75     __select__ = ~no_cnx()
    74 
    76