# HG changeset patch # User Damien Correia # Date 1532017708 -7200 # Node ID a0c0663baf9ead013752c5e5e35e9f9979dd9605 # Parent 2df1cc36531c26ffbbcf65c44a9155717b913589 Updated keynumbers paragraph renderer diff -r 2df1cc36531c -r a0c0663baf9e src/pyams_default_theme/component/paragraph/keynumber.py --- a/src/pyams_default_theme/component/paragraph/keynumber.py Thu Jul 19 18:28:08 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/keynumber.py Thu Jul 19 18:28:28 2018 +0200 @@ -12,31 +12,35 @@ __docformat__ = 'restructuredtext' - # import standard library # import interfaces from pyams_content.component.paragraph.interfaces.keynumber import IKeyNumberParagraph -from pyams_content.features.renderer.interfaces import IContentRenderer +from pyams_content.component.keynumber import IKeyNumberContainer +from pyams_content.features.renderer import IContentRenderer from pyams_skin.layer import IPyAMSLayer # import packages from pyams_content.features.renderer.skin import BaseContentRenderer +from pyams_default_theme import _ from pyams_template.template import template_config from pyams_utils.adapter import adapter_config -from pyams_default_theme import _ # # Base Key numbers paragraph renderer # -class BaseKeyNumberRenderer(BaseContentRenderer): +class BaseKeyNumberParagraphRenderer(BaseContentRenderer): """Default Key Numbers renderer""" i18n_context_attrs = ('title',) + @property + def keynumbers(self): + return IKeyNumberContainer(self.context) + # # Key numbers paragraph default renderer @@ -44,7 +48,7 @@ @adapter_config(name='default', context=(IKeyNumberParagraph, IPyAMSLayer), provides=IContentRenderer) @template_config(template='templates/keynumber-default.pt', layer=IPyAMSLayer) -class DefaultKeyNumberParagraphRenderer(BaseKeyNumberRenderer): +class DefaultKeyNumberParagraphRenderer(BaseKeyNumberParagraphRenderer): """Default Key Numbers renderer""" label = _("Default key numbers renderer") diff -r 2df1cc36531c -r a0c0663baf9e src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt Thu Jul 19 18:28:08 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt Thu Jul 19 18:28:28 2018 +0200 @@ -0,0 +1,18 @@ + +

${i18n:view.title}

+
+
+
+ label +
+
+ Number + Unit +
+ +
+
+