11 from logilab.common.deprecation import class_renamed |
11 from logilab.common.deprecation import class_renamed |
12 from logilab.mtconverter import xml_escape |
12 from logilab.mtconverter import xml_escape |
13 |
13 |
14 from cubicweb import role |
14 from cubicweb import role |
15 from cubicweb.utils import merge_dicts |
15 from cubicweb.utils import merge_dicts |
16 from cubicweb.view import View, Component |
16 from cubicweb.view import Component |
17 from cubicweb.selectors import ( |
17 from cubicweb.selectors import ( |
18 paginated_rset, one_line_rset, primary_view, match_context_prop, |
18 paginated_rset, one_line_rset, primary_view, match_context_prop, |
19 partial_has_related_entities, condition_compat, accepts_compat, |
19 partial_has_related_entities) |
20 has_relation_compat) |
|
21 |
20 |
22 |
21 |
23 class EntityVComponent(Component): |
22 class EntityVComponent(Component): |
24 """abstract base class for additinal components displayed in content |
23 """abstract base class for additinal components displayed in content |
25 headers and footer according to: |
24 headers and footer according to: |
31 .context class attributes |
30 .context class attributes |
32 """ |
31 """ |
33 |
32 |
34 __registry__ = 'contentnavigation' |
33 __registry__ = 'contentnavigation' |
35 __select__ = one_line_rset() & primary_view() & match_context_prop() |
34 __select__ = one_line_rset() & primary_view() & match_context_prop() |
36 registered = accepts_compat(has_relation_compat(condition_compat(View.registered))) |
|
37 |
35 |
38 cw_property_defs = { |
36 cw_property_defs = { |
39 _('visible'): dict(type='Boolean', default=True, |
37 _('visible'): dict(type='Boolean', default=True, |
40 help=_('display the component or not')), |
38 help=_('display the component or not')), |
41 _('order'): dict(type='Int', default=99, |
39 _('order'): dict(type='Int', default=99, |