src/pyams_default_theme/component/paragraph/keynumber.py
changeset 105 9e70ec7ccaa8
parent 104 a050abf1a69c
child 110 a0c0663baf9e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/component/paragraph/keynumber.py	Thu Jul 19 17:20:57 2018 +0200
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__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_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_content.features.renderer.skin import BaseContentRenderer
+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):
+    """Default Key Numbers renderer"""
+
+    i18n_context_attrs = ('title',)
+
+
+#
+#  Key numbers paragraph default renderer
+#
+
+@adapter_config(name='default', context=(IKeyNumberParagraph, IPyAMSLayer), provides=IContentRenderer)
+@template_config(template='templates/keynumber-default.pt', layer=IPyAMSLayer)
+class DefaultKeyNumberParagraphRenderer(BaseKeyNumberRenderer):
+    """Default Key Numbers renderer"""
+
+    label = _("Default key numbers renderer")
+    weight = 1