# HG changeset patch # User Damien Correia # Date 1536067252 -7200 # Node ID a6d503cd9bb1818e91d24765585450b172cc2c08 # Parent a0c0663baf9ead013752c5e5e35e9f9979dd9605# Parent 62632a9571d5063b0b76a0bd640885c9a9469646 Merge default diff -r a0c0663baf9e -r a6d503cd9bb1 .hgtags --- a/.hgtags Thu Jul 19 18:28:28 2018 +0200 +++ b/.hgtags Tue Sep 04 15:20:52 2018 +0200 @@ -5,3 +5,4 @@ 10d9fbc9908f3bcfdd1cb28cfec3d20175a0feb3 0.1.4 b2c3949bb5b8c7bcdf77a6d417cb1e84771db830 0.1.5 c1e5ec49def40a740580aec8c7fc2ead2266ded3 0.1.6 +ca0bd32ae2f16385e77d9eb913a8af16e7614464 0.1.7 diff -r a0c0663baf9e -r a6d503cd9bb1 docs/HISTORY.txt --- a/docs/HISTORY.txt Thu Jul 19 18:28:28 2018 +0200 +++ b/docs/HISTORY.txt Tue Sep 04 15:20:52 2018 +0200 @@ -1,6 +1,11 @@ History ======= +0.1.7 +----- + - updated renderers + - added Opengraph prefix in main layout head + 0.1.6 ----- - use shared content renderer interface diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme.egg-info/PKG-INFO --- a/src/pyams_default_theme.egg-info/PKG-INFO Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme.egg-info/PKG-INFO Tue Sep 04 15:20:52 2018 +0200 @@ -12,6 +12,11 @@ History ======= + 0.1.7 + ----- + - updated renderers + - added Opengraph prefix in main layout head + 0.1.6 ----- - use shared content renderer interface diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme.egg-info/SOURCES.txt --- a/src/pyams_default_theme.egg-info/SOURCES.txt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme.egg-info/SOURCES.txt Tue Sep 04 15:20:52 2018 +0200 @@ -8,6 +8,7 @@ src/pyams_default_theme/page.py src/pyams_default_theme/skin.py src/pyams_default_theme.egg-info/PKG-INFO +src/pyams_default_theme.egg-info/SOURCES (Copie en conflit de xsup98-004 2018-03-10).txt src/pyams_default_theme.egg-info/SOURCES.txt src/pyams_default_theme.egg-info/dependency_links.txt src/pyams_default_theme.egg-info/entry_points.txt @@ -21,7 +22,6 @@ src/pyams_default_theme/component/gallery/__init__.py src/pyams_default_theme/component/gallery/templates/renderer-default.pt src/pyams_default_theme/component/illustration/__init__.py -src/pyams_default_theme/component/illustration/__init__.py.orig src/pyams_default_theme/component/illustration/interfaces/__init__.py src/pyams_default_theme/component/illustration/templates/illustration-default.pt src/pyams_default_theme/component/illustration/templates/illustration-left.pt @@ -31,35 +31,51 @@ src/pyams_default_theme/component/keynumber/portlet/templates/horizontal-render.pt src/pyams_default_theme/component/keynumber/portlet/templates/vertical-render.pt src/pyams_default_theme/component/paragraph/__init__.py +src/pyams_default_theme/component/paragraph/audio.py src/pyams_default_theme/component/paragraph/contact.py src/pyams_default_theme/component/paragraph/frame.py src/pyams_default_theme/component/paragraph/header.py src/pyams_default_theme/component/paragraph/html.py +src/pyams_default_theme/component/paragraph/keynumber.py src/pyams_default_theme/component/paragraph/keypoint.py +src/pyams_default_theme/component/paragraph/map.py +src/pyams_default_theme/component/paragraph/milestone.py +src/pyams_default_theme/component/paragraph/pictogram.py src/pyams_default_theme/component/paragraph/verbatim.py src/pyams_default_theme/component/paragraph/video.py src/pyams_default_theme/component/paragraph/interfaces/__init__.py src/pyams_default_theme/component/paragraph/interfaces/contact.py src/pyams_default_theme/component/paragraph/interfaces/frame.py +src/pyams_default_theme/component/paragraph/interfaces/map.py src/pyams_default_theme/component/paragraph/interfaces/verbatim.py +src/pyams_default_theme/component/paragraph/templates/audio-default.pt src/pyams_default_theme/component/paragraph/templates/contact-default.pt -src/pyams_default_theme/component/paragraph/templates/contact-default.pt.orig src/pyams_default_theme/component/paragraph/templates/frame-default.pt src/pyams_default_theme/component/paragraph/templates/frame-left.pt src/pyams_default_theme/component/paragraph/templates/frame-right.pt src/pyams_default_theme/component/paragraph/templates/header-default.pt src/pyams_default_theme/component/paragraph/templates/html-default.pt +src/pyams_default_theme/component/paragraph/templates/keynumber-default.pt src/pyams_default_theme/component/paragraph/templates/keypoints-default.pt +src/pyams_default_theme/component/paragraph/templates/map-default.pt +src/pyams_default_theme/component/paragraph/templates/milestone-default.pt +src/pyams_default_theme/component/paragraph/templates/pictogram-default.pt src/pyams_default_theme/component/paragraph/templates/raw-default.pt src/pyams_default_theme/component/paragraph/templates/verbatim-default.pt src/pyams_default_theme/component/paragraph/templates/verbatim-left.pt src/pyams_default_theme/component/paragraph/templates/verbatim-right.pt src/pyams_default_theme/component/paragraph/templates/video-default.pt +src/pyams_default_theme/component/paragraph/zmi/__init__.py +src/pyams_default_theme/component/paragraph/zmi/map.py src/pyams_default_theme/component/video/__init__.py -src/pyams_default_theme/component/video/templates/video-default.pt +src/pyams_default_theme/component/video/templates/external-video-default.pt src/pyams_default_theme/doctests/README.txt src/pyams_default_theme/features/__init__.py src/pyams_default_theme/features/footer/__init__.py +src/pyams_default_theme/features/footer/interfaces.py +src/pyams_default_theme/features/footer/skin/__init__.py +src/pyams_default_theme/features/footer/skin/templates/simple-footer.pt +src/pyams_default_theme/features/footer/zmi/__init__.py src/pyams_default_theme/features/header/__init__.py src/pyams_default_theme/features/header/interfaces.py src/pyams_default_theme/features/header/skin/__init__.py @@ -71,13 +87,11 @@ src/pyams_default_theme/features/menu/portlet/navigation/interfaces.py src/pyams_default_theme/features/menu/portlet/navigation/templates/double-select.pt src/pyams_default_theme/features/menu/portlet/navigation/templates/double-vertical.pt -src/pyams_default_theme/features/menu/portlet/navigation/templates/onf.pt src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal-tabs.pt src/pyams_default_theme/features/menu/portlet/navigation/templates/simple-horizontal.pt src/pyams_default_theme/interfaces/__init__.py src/pyams_default_theme/locales/pyams_default_theme.pot src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo -src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo.orig src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po src/pyams_default_theme/resources/css/pyams-default.css src/pyams_default_theme/resources/css/pyams-default.css.map diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/association/__init__.py --- a/src/pyams_default_theme/component/association/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/association/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -18,13 +18,20 @@ # import interfaces from pyams_content.component.association.interfaces import IAssociationParagraph, IAssociationInfo, \ IAssociationContainer +from pyams_content.component.links.interfaces import IInternalLink +from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer from pyams_content.features.renderer.interfaces import IContentRenderer +from pyams_default_theme.component.association.interfaces import IAssociationParagraphRemoteContentRendererSettings from pyams_skin.layer import IPyAMSLayer # import packages +from persistent import Persistent from pyams_content.features.renderer.skin import BaseContentRenderer from pyams_template.template import template_config -from pyams_utils.adapter import adapter_config +from pyams_utils.adapter import adapter_config, get_annotation_adapter +from zope.interface import implementer +from zope.location import Location +from zope.schema.fieldproperty import FieldProperty from pyams_default_theme import _ @@ -39,6 +46,7 @@ """Associations paragraph default renderer""" label = _("Default associations renderer") + associations = () i18n_context_attrs = ('title', ) @@ -46,4 +54,52 @@ super(AssociationParagraphDefaultRenderer, self).update() self.associations = [{'url': item.get_url(self.request), 'title': IAssociationInfo(item).user_title} - for item in IAssociationContainer(self.context).values() if item.visible] + for item in IAssociationContainer(self.context).get_visible_items(self.request)] + + +# +# Associations paragraph remote content renderer +# + +ASSOCIATION_PARAGRAPH_REMOTE_CONTENT_RENDERER_SETTINGS_KEY = 'pyams_content.association.renderer:remote-content' + + +@implementer(IAssociationParagraphRemoteContentRendererSettings) +class AssociationParagraphRemoteContentRendererSettings(Persistent, Location): + """Associations paragraph remote content renderer settings""" + + display_title = FieldProperty(IAssociationParagraphRemoteContentRendererSettings['display_title']) + display_header = FieldProperty(IAssociationParagraphRemoteContentRendererSettings['display_header']) + anchors_only = FieldProperty(IAssociationParagraphRemoteContentRendererSettings['anchors_only']) + factories = FieldProperty(IAssociationParagraphRemoteContentRendererSettings['factories']) + + +@adapter_config(context=IAssociationParagraph, provides=IAssociationParagraphRemoteContentRendererSettings) +def association_paragraph_remote_content_renderer_settings_factory(context): + """Associations paragraph remote content renderer settings factory""" + return get_annotation_adapter(context, ASSOCIATION_PARAGRAPH_REMOTE_CONTENT_RENDERER_SETTINGS_KEY, + AssociationParagraphRemoteContentRendererSettings) + + +@adapter_config(name='remote-content', context=(IAssociationParagraph, IPyAMSLayer), provides=IContentRenderer) +@template_config(template='templates/association-remote-content.pt', layer=IPyAMSLayer) +class AssociationParagraphRemoteContentRenderer(BaseContentRenderer): + """Associations container remote content renderer""" + + label = _("Include remote content") + + i18n_context_attrs = ('title', ) + links = () + + settings_interface = IAssociationParagraphRemoteContentRendererSettings + + def update(self): + super(AssociationParagraphRemoteContentRenderer, self).update() + self.links = [item for item in IAssociationContainer(self.context).get_visible_items(self.request) + if IInternalLink.providedBy(item) and IParagraphContainerTarget.providedBy(item.target)] + + def get_paragraphs(self, target): + container = IParagraphContainer(target, None) + if container is not None: + settings = self.settings + yield from container.get_visible_paragraphs(settings.anchors_only, settings.factories) diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/association/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/component/association/interfaces/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -0,0 +1,50 @@ +# +# Copyright (c) 2008-2018 Thierry Florac +# 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 import PARAGRAPH_FACTORIES_VOCABULARY + +# import packages +from zope.interface import Interface +from zope.schema import Bool, Set, Choice + +from pyams_default_theme import _ + + +class IAssociationParagraphRemoteContentRendererSettings(Interface): + """Associations paragraph remote content renderer settings interface""" + + display_title = Bool(title=_("Display title?"), + description=_("Choose 'yes' to display remote content's title"), + required=True, + default=False) + + display_header = Bool(title=_("Display header?"), + description=_("Choose 'yes' to display remote content's header"), + required=True, + default=False) + + anchors_only = Bool(title=_("Anchors only?"), + description=_("If 'yes', only paragraphs set as 'anchors' will be selected"), + required=True, + default=True) + + factories = Set(title=_("Paragraph types"), + description=_("Select list of paragraph types you want to include; an empty " + "selection means that all paragraphs will be selected"), + required=False, + value_type=Choice(vocabulary=PARAGRAPH_FACTORIES_VOCABULARY)) diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/association/templates/association-remote-content.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/component/association/templates/association-remote-content.pt Tue Sep 04 15:20:52 2018 +0200 @@ -0,0 +1,17 @@ + + + +

${i18n:target.title}

+
${structure:tales:html(header)}
+ + ${structure:renderer.render()} + +
+
+
diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/gallery/templates/renderer-default.pt --- a/src/pyams_default_theme/component/gallery/templates/renderer-default.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/gallery/templates/renderer-default.pt Tue Sep 04 15:20:52 2018 +0200 @@ -2,23 +2,36 @@ - - - - - + timestamp tales:timestamp(image); + base_width 100 / 12;"> + + + + + + + + + + diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/illustration/__init__.py --- a/src/pyams_default_theme/component/illustration/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/illustration/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -19,7 +19,8 @@ # import interfaces from pyams_content.component.illustration.interfaces import IIllustration from pyams_content.features.renderer.interfaces import IContentRenderer -from pyams_default_theme.component.illustration.interfaces import IIllustrationWithZoomSettings +from pyams_default_theme.component.illustration.interfaces import IIllustrationWithZoomSettings, IIllustrationRenderer, \ + ILLUSTRATION_AFTER_BODY, ILLUSTRATION_BEFORE_BODY from pyams_skin.layer import IPyAMSLayer # import packages @@ -57,21 +58,26 @@ # Illustration renderers # +@implementer(IIllustrationRenderer) class BaseIllustrationRenderer(BaseContentRenderer): """Base illustration renderer""" context_attrs = ('author', ) i18n_context_attrs = ('title', 'alt_title', 'description', 'data') + position = None -@adapter_config(name='default', context=(IIllustration, IPyAMSLayer), provides=IContentRenderer) + +@adapter_config(name='centered-before-body', context=(IIllustration, IPyAMSLayer), provides=IContentRenderer) @template_config(template='templates/illustration-default.pt', layer=IPyAMSLayer) class DefaultIllustrationRenderer(BaseIllustrationRenderer): """Default illustration renderer""" - label = _("Centered illustration") + label = _("Centered illustration before text") weight = 1 + position = ILLUSTRATION_BEFORE_BODY + @adapter_config(name='left+zoom', context=(IIllustration, IPyAMSLayer), provides=IContentRenderer) @template_config(template='templates/illustration-left.pt', layer=IPyAMSLayer) @@ -81,6 +87,7 @@ label = _("Small illustration on the left") weight = 2 + position = ILLUSTRATION_BEFORE_BODY settings_interface = IIllustrationWithZoomSettings @@ -92,4 +99,16 @@ label = _("Small illustration on the right") weight = 3 + position = ILLUSTRATION_BEFORE_BODY settings_interface = IIllustrationWithZoomSettings + + +@adapter_config(name='default', context=(IIllustration, IPyAMSLayer), provides=IContentRenderer) +@template_config(template='templates/illustration-default.pt', layer=IPyAMSLayer) +class DefaultIllustrationRenderer(BaseIllustrationRenderer): + """Default illustration renderer""" + + label = _("Centered illustration after text") + weight = 4 + + position = ILLUSTRATION_AFTER_BODY diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/illustration/interfaces/__init__.py --- a/src/pyams_default_theme/component/illustration/interfaces/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/illustration/interfaces/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -18,16 +18,27 @@ # import interfaces # import packages -from zope.interface import Interface -from zope.schema import Bool +from zope.interface import Interface, Attribute +from zope.schema import Bool, Choice from pyams_default_theme import _ +ILLUSTRATION_BEFORE_TITLE = 'before-title' +ILLUSTRATION_BEFORE_BODY = 'before-body' +ILLUSTRATION_AFTER_BODY = 'after-body' + + +class IIllustrationRenderer(Interface): + """Illustration renderer interface""" + + position = Attribute("Illustration position related to it's attached content") + + class IIllustrationWithZoomSettings(Interface): """Illustration with zoom interface""" zoom_on_click = Bool(title=_("Zoom on click?"), description=_("If 'yes', a click on illustration thumbnail is required to zoom"), required=True, - default=True) \ No newline at end of file + default=True) diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/illustration/templates/illustration-default.pt --- a/src/pyams_default_theme/component/illustration/templates/illustration-default.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/illustration/templates/illustration-default.pt Tue Sep 04 15:20:52 2018 +0200 @@ -1,20 +1,36 @@
- - - - - - + + + + + + + + + + + legend
diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/keynumber/__init__.py --- a/src/pyams_default_theme/component/keynumber/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/keynumber/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -1,5 +1,5 @@ # -# Copyright (c) 2008-2018 Thierry Florac +# Copyright (c) 2008-2015 Thierry Florac # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, @@ -12,9 +12,43 @@ __docformat__ = 'restructuredtext' - # import standard library # import interfaces +from pyams_content.component.keynumber.interfaces import IKeyNumberContainer, 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 BaseKeyNumberParagraphRenderer(BaseContentRenderer): + """Default Key Numbers renderer""" + + i18n_context_attrs = ('title', ) + + @property + def keynumbers(self): + return IKeyNumberContainer(self.context) + + +# +# 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(BaseKeyNumberParagraphRenderer): + """Default Key Numbers renderer""" + + label = _("Default key numbers renderer") + weight = 1 diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_default_theme/component/keynumber/templates/keynumber-default.pt Tue Sep 04 15:20:52 2018 +0200 @@ -0,0 +1,19 @@ + +

${i18n:view.title}

+
+
+
+ ${i18n:number.label} +
+
+ ${i18n:number.number} + ${i18n:number.unit} +
+ +
+
+
diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/__init__.py --- a/src/pyams_default_theme/component/paragraph/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -40,8 +40,12 @@ def update(self): super(ParagraphPreviewPage, self).update() - self.renderer.language = self.language - self.renderer.update() + if self.renderer is not None: + self.renderer.language = self.language + self.renderer.update() def render(self): - return self.renderer.render() + if self.renderer is not None: + return self.renderer.render() + else: + return '' diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/header.py --- a/src/pyams_default_theme/component/paragraph/header.py Thu Jul 19 18:28:28 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -# -# Copyright (c) 2008-2017 Thierry Florac -# 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.header import IHeaderParagraph -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 _ - - -# -# Header paragraph default renderer -# - -@adapter_config(name='default', context=(IHeaderParagraph, IPyAMSLayer), provides=IContentRenderer) -@template_config(template='templates/header-default.pt', layer=IPyAMSLayer) -class HeaderParagraphDefaultRenderer(BaseContentRenderer): - """Header paragraph default renderer""" - - label = _("Default header renderer") - - i18n_context_attrs = ('header', ) diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/keynumber.py --- a/src/pyams_default_theme/component/paragraph/keynumber.py Thu Jul 19 18:28:28 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# -# Copyright (c) 2008-2015 Thierry Florac -# 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.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 - - - -# -# Base Key numbers paragraph renderer -# - -class BaseKeyNumberParagraphRenderer(BaseContentRenderer): - """Default Key Numbers renderer""" - - i18n_context_attrs = ('title',) - - @property - def keynumbers(self): - return IKeyNumberContainer(self.context) - - -# -# 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(BaseKeyNumberParagraphRenderer): - """Default Key Numbers renderer""" - - label = _("Default key numbers renderer") - weight = 1 diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/keypoint.py --- a/src/pyams_default_theme/component/paragraph/keypoint.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/keypoint.py Tue Sep 04 15:20:52 2018 +0200 @@ -39,7 +39,7 @@ label = _("Default key points renderer") - i18n_context_attrs = ('body', ) + i18n_context_attrs = ('title', 'body', ) @property def keypoints(self): diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/templates/header-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/header-default.pt Thu Jul 19 18:28:28 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -
header
diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/component/paragraph/templates/html-default.pt --- a/src/pyams_default_theme/component/paragraph/templates/html-default.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/component/paragraph/templates/html-default.pt Tue Sep 04 15:20:52 2018 +0200 @@ -1,3 +1,9 @@ -

title

-
body
-Illustration + + ${structure:view.render_illustration()} +

${view.title}

+ ${structure:view.render_illustration()} +
${structure:tales:html(view.body, 'oid_to_href')}
+ ${structure:view.render_illustration()} +
diff -r a0c0663baf9e -r a6d503cd9bb1 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:28 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - -

${i18n:view.title}

-
-
-
- label -
-
- Number - Unit -
- -
-
-
diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/features/footer/skin/__init__.py --- a/src/pyams_default_theme/features/footer/skin/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/features/footer/skin/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -31,7 +31,7 @@ from pyams_default_theme import _ -SIMPLE_FOOTER_RENDERER_NAME = 'PyAMS simple header' +SIMPLE_FOOTER_RENDERER_NAME = 'PyAMS simple footer' # diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/features/footer/skin/templates/simple-footer.pt --- a/src/pyams_default_theme/features/footer/skin/templates/simple-footer.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/features/footer/skin/templates/simple-footer.pt Tue Sep 04 15:20:52 2018 +0200 @@ -10,6 +10,8 @@
  • ${settings.copyright}
  • + tal:condition="settings.copyright"> + ${settings.copyright} + diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/features/header/__init__.py --- a/src/pyams_default_theme/features/header/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/features/header/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -82,7 +82,7 @@ return context.tabs -@adapter_config(name='links', context=ISimpleHeaderRendererSettings, provides=ISublocations) +@adapter_config(name='tabs', context=ISimpleHeaderRendererSettings, provides=ISublocations) class SimpleHeaderRendererSettingsSublocations(ContextAdapter): """Simple header renderer settings sub-locations adapter""" diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/features/header/skin/templates/simple-header.pt --- a/src/pyams_default_theme/features/header/skin/templates/simple-header.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/features/header/skin/templates/simple-header.pt Tue Sep 04 15:20:52 2018 +0200 @@ -1,5 +1,6 @@
    + tal:define="settings view.settings" + tal:condition="settings is not None" i18n:domain="pyams_default_theme"> diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo Binary file src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo has changed diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po --- a/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po Tue Sep 04 15:20:52 2018 +0200 @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2018-07-19 17:00+0200\n" +"POT-Creation-Date: 2018-09-03 15:38+0200\n" "PO-Revision-Date: 2017-06-07 12:41+0200\n" "Last-Translator: Thierry Florac \n" "Language-Team: French\n" @@ -24,6 +24,10 @@ msgid "Default gallery renderer" msgstr "Par défaut" +#: src/pyams_default_theme/component/keynumber/__init__.py:53 +msgid "Default key numbers renderer" +msgstr "Par défaut" + #: src/pyams_default_theme/component/keynumber/portlet/__init__.py:55 msgid "Horizontal list with carousel" msgstr "Liste horizontale (par défaut)" @@ -32,23 +36,27 @@ msgid "Vertical list" msgstr "Liste verticale" -#: src/pyams_default_theme/component/illustration/__init__.py:72 -msgid "Centered illustration" -msgstr "Illustration centrée (par défaut)" +#: src/pyams_default_theme/component/illustration/__init__.py:76 +msgid "Centered illustration before text" +msgstr "Illustration centrée avant le texte" -#: src/pyams_default_theme/component/illustration/__init__.py:81 +#: src/pyams_default_theme/component/illustration/__init__.py:87 msgid "Small illustration on the left" msgstr "Illustration sur la gauche" -#: src/pyams_default_theme/component/illustration/__init__.py:92 +#: src/pyams_default_theme/component/illustration/__init__.py:99 msgid "Small illustration on the right" msgstr "Illustration sur la droite" -#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:30 +#: src/pyams_default_theme/component/illustration/__init__.py:111 +msgid "Centered illustration after text" +msgstr "Illustration centrée après le texte" + +#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:41 msgid "Zoom on click?" msgstr "Zoom sur clic ?" -#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:31 +#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:42 msgid "If 'yes', a click on illustration thumbnail is required to zoom" msgstr "" "Si 'oui', un clic sur la vignette de l'illustration est nécessaire pour " @@ -79,10 +87,6 @@ msgid "Default audio renderer" msgstr "Par défaut" -#: src/pyams_default_theme/component/paragraph/keynumber.py:50 -msgid "Default key numbers renderer" -msgstr "Par défaut" - #: src/pyams_default_theme/component/paragraph/frame.py:123 msgid "Default frame renderer" msgstr "Encadré en pleine largeur (par défaut)" @@ -113,10 +117,6 @@ msgid "Default contact renderer" msgstr "Encadré en pleine largeur (par défaut)" -#: src/pyams_default_theme/component/paragraph/header.py:40 -msgid "Default header renderer" -msgstr "Par défaut" - #: src/pyams_default_theme/component/paragraph/zmi/map.py:62 msgid "Don't use default map configuration" msgstr "Ne pas utiliser la configuration de carte par défaut" @@ -218,10 +218,50 @@ msgid "Map position" msgstr "Position de la carte" -#: src/pyams_default_theme/component/association/__init__.py:41 +#: src/pyams_default_theme/component/association/__init__.py:48 msgid "Default associations renderer" msgstr "Par défaut" +#: src/pyams_default_theme/component/association/__init__.py:89 +msgid "Include remote content" +msgstr "Include les blocs de contenu distants" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:31 +msgid "Display title?" +msgstr "Afficher le titre ?" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:32 +msgid "Choose 'yes' to display remote content's title" +msgstr "Choisissez 'oui' pour afficher le titre des contenus liés" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:36 +msgid "Display header?" +msgstr "Afficher le chapô ?" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:37 +msgid "Choose 'yes' to display remote content's header" +msgstr "Choisissez 'oui' pour afficher le chapô des contenus liés" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:41 +msgid "Anchors only?" +msgstr "Ancres seulement ?" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:42 +msgid "If 'yes', only paragraphs set as 'anchors' will be selected" +msgstr "Si 'oui', seuls les blocs de contenu désignés comme ancres seront sélectionnés" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:46 +msgid "Paragraph types" +msgstr "Types de blocs" + +#: src/pyams_default_theme/component/association/interfaces/__init__.py:47 +msgid "" +"Select list of paragraph types you want to include; an empty selection means " +"that all paragraphs will be selected" +msgstr "" +"Sélectionnez le type des blocs de contenu que vous souhaitez intégrer ; si vous laissez " +"la sélection vide, tous les types de blocs seront pris en compte" + #: src/pyams_default_theme/shared/view/templates/render.pt:2 msgid "View result items" msgstr "Aperçu du contenu de la vue" @@ -324,6 +364,9 @@ msgid "PyAMS simple header with banner and tabs" msgstr "PyAMS: en-tête simple avec bandeau et onglets de navigation" +#~ msgid "Default header renderer" +#~ msgstr "Par défaut" + #~ msgid "Search..." #~ msgstr "Chercher..." diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/locales/pyams_default_theme.pot --- a/src/pyams_default_theme/locales/pyams_default_theme.pot Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/locales/pyams_default_theme.pot Tue Sep 04 15:20:52 2018 +0200 @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE 1.0\n" -"POT-Creation-Date: 2018-07-19 17:00+0200\n" +"POT-Creation-Date: 2018-09-03 15:38+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" @@ -24,6 +24,10 @@ msgid "Default gallery renderer" msgstr "" +#: ./src/pyams_default_theme/component/keynumber/__init__.py:53 +msgid "Default key numbers renderer" +msgstr "" + #: ./src/pyams_default_theme/component/keynumber/portlet/__init__.py:55 msgid "Horizontal list with carousel" msgstr "" @@ -32,23 +36,27 @@ msgid "Vertical list" msgstr "" -#: ./src/pyams_default_theme/component/illustration/__init__.py:72 -msgid "Centered illustration" +#: ./src/pyams_default_theme/component/illustration/__init__.py:76 +msgid "Centered illustration before text" msgstr "" -#: ./src/pyams_default_theme/component/illustration/__init__.py:81 +#: ./src/pyams_default_theme/component/illustration/__init__.py:87 msgid "Small illustration on the left" msgstr "" -#: ./src/pyams_default_theme/component/illustration/__init__.py:92 +#: ./src/pyams_default_theme/component/illustration/__init__.py:99 msgid "Small illustration on the right" msgstr "" -#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:30 +#: ./src/pyams_default_theme/component/illustration/__init__.py:111 +msgid "Centered illustration after text" +msgstr "" + +#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:41 msgid "Zoom on click?" msgstr "" -#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:31 +#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:42 msgid "If 'yes', a click on illustration thumbnail is required to zoom" msgstr "" @@ -77,10 +85,6 @@ msgid "Default audio renderer" msgstr "" -#: ./src/pyams_default_theme/component/paragraph/keynumber.py:50 -msgid "Default key numbers renderer" -msgstr "" - #: ./src/pyams_default_theme/component/paragraph/frame.py:123 msgid "Default frame renderer" msgstr "" @@ -111,10 +115,6 @@ msgid "Default contact renderer" msgstr "" -#: ./src/pyams_default_theme/component/paragraph/header.py:40 -msgid "Default header renderer" -msgstr "" - #: ./src/pyams_default_theme/component/paragraph/zmi/map.py:62 msgid "Don't use default map configuration" msgstr "" @@ -203,10 +203,48 @@ msgid "Map position" msgstr "" -#: ./src/pyams_default_theme/component/association/__init__.py:41 +#: ./src/pyams_default_theme/component/association/__init__.py:48 msgid "Default associations renderer" msgstr "" +#: ./src/pyams_default_theme/component/association/__init__.py:89 +msgid "Include remote content" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:31 +msgid "Display title?" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:32 +msgid "Choose 'yes' to display remote content's title" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:36 +msgid "Display header?" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:37 +msgid "Choose 'yes' to display remote content's header" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:41 +msgid "Anchors only?" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:42 +msgid "If 'yes', only paragraphs set as 'anchors' will be selected" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:46 +msgid "Paragraph types" +msgstr "" + +#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:47 +msgid "" +"Select list of paragraph types you want to include; an empty selection means " +"that all paragraphs will be selected" +msgstr "" + #: ./src/pyams_default_theme/shared/view/templates/render.pt:2 msgid "View result items" msgstr "" diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/resources/css/pyams-default.css.map --- a/src/pyams_default_theme/resources/css/pyams-default.css.map Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/resources/css/pyams-default.css.map Tue Sep 04 15:20:52 2018 +0200 @@ -1,1 +1,1 @@ -{"version":3,"sources":["../less/pyams-default.less"],"names":[],"mappings":"AAAA;EACC,cAAA;;AADD,IAGC,eACC;EACC,kBAAA;;AAIC,IANH,eACC,eAGC,QAEE;AAAD,IANH,eACC,eAIC,IACE;EACA,WAAA;;AAED,IATH,eACC,eAGC,QAKE;AAAD,IATH,eACC,eAIC,IAIE;EACA,kBAAA;EACA,SAAA;EACA,UAAA;EACA,YAAY,SAAZ;;AAUH,wBAA2C;EAC1C,YAFF,MAEG;IACA,aAAA;;;AAGF,wBAA0C,uBAAwB;EACjE,YAPF,MAOG;IACA,aAAA;;;AAGF,wBAA0C,uBAAuB;EAChE,YAZF,MAYG;IACA,aAAA;;;AAGF,wBAA0C;EACzC,YAjBF,MAiBG;IACA,aAAA;;;AAQH,cAAC;EACA,mBAAA;;AAED,cAAC;EACA,mBAAA","file":"pyams-default.css"} \ No newline at end of file +{"version":3,"sources":["../../../../../../../../../home/tflorac/Dropbox/src/PyAMS/pyams_default_theme/src/pyams_default_theme/resources/less/pyams-default.less"],"names":[],"mappings":"AAAA;EACC,cAAA;;AADD,IAGC,eACC;EACC,kBAAA;;AAIC,IANH,eACC,eAGC,QAEE;AAAD,IANH,eACC,eAIC,IACE;EACA,WAAA;;AAED,IATH,eACC,eAGC,QAKE;AAAD,IATH,eACC,eAIC,IAIE;EACA,kBAAA;EACA,SAAA;EACA,UAAA;EACA,YAAY,SAAZ;;AAUH,wBAA2C;EAC1C,YAFF,MAEG;IACA,aAAA;;;AAGF,wBAA0C,uBAAwB;EACjE,YAPF,MAOG;IACA,aAAA;;;AAGF,wBAA0C,uBAAuB;EAChE,YAZF,MAYG;IACA,aAAA;;;AAGF,wBAA0C;EACzC,YAjBF,MAiBG;IACA,aAAA;;;AAQH,cAAC;EACA,mBAAA;;AAED,cAAC;EACA,mBAAA","file":"pyams-default.css"} \ No newline at end of file diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/shared/common/__init__.py --- a/src/pyams_default_theme/shared/common/__init__.py Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/shared/common/__init__.py Tue Sep 04 15:20:52 2018 +0200 @@ -16,7 +16,7 @@ # import standard library # import interfaces -from pyams_content.component.illustration import ILinkIllustration, IIllustration +from pyams_content.component.illustration import ILinkIllustration, IIllustration, IBasicIllustrationTarget from pyams_content.interfaces import IBaseContent from pyams_content.shared.common.interfaces import IWfSharedContent from pyams_default_theme.interfaces import IContentNavigationTitle, IContentTag, IContentDate, \ @@ -91,6 +91,7 @@ @adapter_config(context=(IBaseContent, IPyAMSLayer), provides=IContentNavigationIllustration) +@adapter_config(context=(IBasicIllustrationTarget, IPyAMSLayer), provides=IContentNavigationIllustration) def base_content_navigation_illustration_adapter(context, request): """Default content navigation illustration adapter""" illustration = ILinkIllustration(context, None) diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/templates/layout.pt --- a/src/pyams_default_theme/templates/layout.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/templates/layout.pt Tue Sep 04 15:20:52 2018 +0200 @@ -32,7 +32,7 @@
    -
    +
    diff -r a0c0663baf9e -r a6d503cd9bb1 src/pyams_default_theme/templates/preview-layout.pt --- a/src/pyams_default_theme/templates/preview-layout.pt Thu Jul 19 18:28:28 2018 +0200 +++ b/src/pyams_default_theme/templates/preview-layout.pt Tue Sep 04 15:20:52 2018 +0200 @@ -29,7 +29,7 @@
    -
    +