# HG changeset patch # User Thierry Florac # Date 1532074380 -7200 # Node ID 0a71298d125aafaf8fd9e9ead7293460907c918c # Parent da1f756d71581a3d3321e436ae8cf11fb8de79e3# Parent a0c0663baf9ead013752c5e5e35e9f9979dd9605 Merge branch dev-dc diff -r da1f756d7158 -r 0a71298d125a src/pyams_default_theme/component/paragraph/keynumber.py --- a/src/pyams_default_theme/component/paragraph/keynumber.py Fri Jul 20 01:42:45 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/keynumber.py Fri Jul 20 10:13:00 2018 +0200 @@ -12,11 +12,11 @@ __docformat__ = 'restructuredtext' - # import standard library # import interfaces from pyams_content.component.paragraph.interfaces.keynumber import IKeyNumberParagraph +from pyams_content.component.keynumber.interfaces import IKeyNumberContainer from pyams_content.features.renderer.interfaces import IContentRenderer from pyams_skin.layer import IPyAMSLayer @@ -32,10 +32,14 @@ # Base Key numbers paragraph renderer # -class BaseKeyNumberRenderer(BaseContentRenderer): +class BaseKeyNumberParagraphRenderer(BaseContentRenderer): """Default Key Numbers renderer""" - i18n_context_attrs = ('title',) + i18n_context_attrs = ('title', ) + + @property + def keynumbers(self): + return IKeyNumberContainer(self.context) # @@ -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 da1f756d7158 -r 0a71298d125a src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt Fri Jul 20 01:42:45 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt Fri Jul 20 10:13:00 2018 +0200 @@ -0,0 +1,19 @@ + +

${i18n:view.title}

+
+
+
+ ${i18n:number.label} +
+
+ ${i18n:number.number} + ${i18n:number.unit} +
+ +
+
+