--- a/.hgtags Thu Sep 06 18:14:22 2018 +0200
+++ b/.hgtags Fri Oct 05 14:10:51 2018 +0200
@@ -6,3 +6,5 @@
b2c3949bb5b8c7bcdf77a6d417cb1e84771db830 0.1.5
c1e5ec49def40a740580aec8c7fc2ead2266ded3 0.1.6
ca0bd32ae2f16385e77d9eb913a8af16e7614464 0.1.7
+85907babe16b8cd8cfb64dadfb7203f23450d493 0.1.8
+461fa3beb4386cf6764d60d59c4854fbba01833b 0.1.9
--- a/buildout.cfg Thu Sep 06 18:14:22 2018 +0200
+++ b/buildout.cfg Fri Oct 05 14:10:51 2018 +0200
@@ -79,4 +79,4 @@
eggs = pyams_default_theme [test]
[versions]
-pyams_default_theme = 0.1.7
+pyams_default_theme = 0.1.10
--- a/docs/HISTORY.txt Thu Sep 06 18:14:22 2018 +0200
+++ b/docs/HISTORY.txt Fri Oct 05 14:10:51 2018 +0200
@@ -1,6 +1,15 @@
History
=======
+0.1.9
+-----
+ - updated templates and renderers
+
+0.1.8
+-----
+ - added navigation illustration adapter for basic illustration target
+ - updated pictures templates
+
0.1.7
-----
- updated renderers
--- a/setup.py Thu Sep 06 18:14:22 2018 +0200
+++ b/setup.py Fri Oct 05 14:10:51 2018 +0200
@@ -22,7 +22,7 @@
README = os.path.join(DOCS, 'README.txt')
HISTORY = os.path.join(DOCS, 'HISTORY.txt')
-version = '0.1.7'
+version = '0.1.10'
long_description = open(README).read() + '\n\n' + open(HISTORY).read()
tests_require = []
--- a/src/pyams_default_theme.egg-info/PKG-INFO Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme.egg-info/PKG-INFO Fri Oct 05 14:10:51 2018 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyams-default-theme
-Version: 0.1.7
+Version: 0.1.9
Summary: PyAMS default theme
Home-page: http://hg.ztfy.org/pyams/pyams_default_theme
Author: Thierry Florac
@@ -12,6 +12,15 @@
History
=======
+ 0.1.9
+ -----
+ - updated templates and renderers
+
+ 0.1.8
+ -----
+ - added navigation illustration adapter for basic illustration target
+ - updated pictures templates
+
0.1.7
-----
- updated renderers
--- a/src/pyams_default_theme.egg-info/SOURCES.txt Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme.egg-info/SOURCES.txt Fri Oct 05 14:10:51 2018 +0200
@@ -18,7 +18,9 @@
src/pyams_default_theme.egg-info/top_level.txt
src/pyams_default_theme/component/__init__.py
src/pyams_default_theme/component/association/__init__.py
+src/pyams_default_theme/component/association/interfaces/__init__.py
src/pyams_default_theme/component/association/templates/association-default.pt
+src/pyams_default_theme/component/association/templates/association-remote-content.pt
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
@@ -30,13 +32,12 @@
src/pyams_default_theme/component/keynumber/portlet/__init__.py
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/keynumber/templates/keynumber-default.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
@@ -48,14 +49,15 @@
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/portlet/__init__.py
+src/pyams_default_theme/component/paragraph/portlet/templates/content.pt
+src/pyams_default_theme/component/paragraph/portlet/templates/navigation.pt
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/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
@@ -66,6 +68,7 @@
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/frame.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/external-video-default.pt
@@ -101,14 +104,17 @@
src/pyams_default_theme/resources/js/pyams-default.min.js
src/pyams_default_theme/resources/less/pyams-default.less
src/pyams_default_theme/shared/__init__.py
-src/pyams_default_theme/shared/common.py
src/pyams_default_theme/shared/common/__init__.py
+src/pyams_default_theme/shared/common/portlet/__init__.py
+src/pyams_default_theme/shared/common/portlet/head.py
+src/pyams_default_theme/shared/common/portlet/title.py
+src/pyams_default_theme/shared/common/portlet/templates/head.pt
+src/pyams_default_theme/shared/common/portlet/templates/title.pt
src/pyams_default_theme/shared/imagemap/__init__.py
src/pyams_default_theme/shared/imagemap/templates/imagemap-default.pt
src/pyams_default_theme/shared/imagemap/templates/render.pt
src/pyams_default_theme/shared/logo/__init__.py
src/pyams_default_theme/shared/logo/templates/logos-default.pt
-src/pyams_default_theme/shared/templates/content-header.pt
src/pyams_default_theme/shared/view/__init__.py
src/pyams_default_theme/shared/view/portlet/__init__.py
src/pyams_default_theme/shared/view/portlet/templates/view-items-list.pt
@@ -123,4 +129,6 @@
src/pyams_default_theme/viewlet/banner/__init__.py
src/pyams_default_theme/viewlet/banner/templates/banner.pt
src/pyams_default_theme/viewlet/logo/__init__.py
-src/pyams_default_theme/viewlet/logo/templates/logo.pt
\ No newline at end of file
+src/pyams_default_theme/viewlet/logo/templates/logo.pt
+src/pyams_default_theme/viewlet/tag/__init__.py
+src/pyams_default_theme/viewlet/tag/templates/tags.pt
\ No newline at end of file
--- a/src/pyams_default_theme/component/association/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/association/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -97,8 +97,12 @@
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):
+ def get_renderers(self, target):
container = IParagraphContainer(target, None)
if container is not None:
settings = self.settings
- yield from container.get_visible_paragraphs(None, settings.anchors_only, settings.factories)
+ for renderer in map(lambda x: x.get_renderer(self.request),
+ container.get_visible_paragraphs(None, settings.anchors_only, settings.factories)):
+ if renderer is not None:
+ renderer.update()
+ yield renderer.render()
--- a/src/pyams_default_theme/component/association/templates/association-remote-content.pt Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/association/templates/association-remote-content.pt Fri Oct 05 14:10:51 2018 +0200
@@ -7,10 +7,8 @@
<div class="chapo"
tal:define="header i18n:target.header"
tal:condition="settings.display_header">${structure:tales:html(header)}</div>
- <tal:loop repeat="paragraph view.get_paragraphs(target)">
- <tal:var define="renderer paragraph.get_renderer(request);
- ignore renderer.update() if renderer is not None else None;"
- condition="renderer is not None">${structure:renderer.render()}</tal:var>
+ <tal:loop repeat="renderer view.get_renderers(target)">
+ ${structure:renderer}
</tal:loop>
</tal:var>
</tal:loop>
--- a/src/pyams_default_theme/component/gallery/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/gallery/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -13,26 +13,20 @@
__docformat__ = 'restructuredtext'
-# import standard library
-
-# import interfaces
-from pyams_content.component.gallery import IGallery
+from pyams_content.component.gallery.interfaces import IBaseGallery
from pyams_content.features.renderer.interfaces import IContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_default_theme import _
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 _
-
class BaseGalleryRenderer(BaseContentRenderer):
"""Base gallery renderer"""
-@adapter_config(name='default', context=(IGallery, IPyAMSLayer), provides=IContentRenderer)
+@adapter_config(name='default', context=(IBaseGallery, IPyAMSLayer), provides=IContentRenderer)
@template_config(template='templates/renderer-default.pt', layer=IPyAMSLayer)
class DefaultGalleryRenderer(BaseGalleryRenderer):
"""Default gallery renderer"""
--- a/src/pyams_default_theme/component/illustration/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/illustration/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -12,26 +12,68 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
from persistent import Persistent
-
-# 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, IIllustrationRenderer, \
- ILLUSTRATION_AFTER_BODY, ILLUSTRATION_BEFORE_BODY
-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, get_annotation_adapter
-from zope.interface import implementer
-from zope.location import locate, Location
+from zope.interface import Interface, implementer
+from zope.location import Location
from zope.schema.fieldproperty import FieldProperty
+from pyams_content.component.illustration import IBasicIllustrationTarget, ILinkIllustration
+from pyams_content.component.illustration.interfaces import IIllustration
+from pyams_content.component.links import IInternalLink
+from pyams_content.features.renderer.interfaces import IContentRenderer
+from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_content.interfaces import IBaseContent
+from pyams_content.root import ISiteRoot
from pyams_default_theme import _
+from pyams_default_theme.component.illustration.interfaces import IIllustrationRenderer, IIllustrationWithZoomSettings, \
+ ILLUSTRATION_AFTER_BODY, ILLUSTRATION_BEFORE_BODY
+from pyams_default_theme.interfaces import IContentHeaderIllustration, IContentNavigationIllustration
+from pyams_skin.layer import IPyAMSLayer
+from pyams_template.template import template_config
+from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config, get_annotation_adapter
+from pyams_utils.interfaces.tales import ITALESExtension
+
+
+#
+# Illustrations adapters
+#
+
+@adapter_config(context=(IBasicIllustrationTarget, IPyAMSLayer), provides=IContentNavigationIllustration)
+def base_content_navigation_illustration_adapter(context, request):
+ """Default content navigation illustration adapter"""
+ illustration = ILinkIllustration(context, None)
+ if not (illustration and illustration.has_data()):
+ illustration = IIllustration(context, None)
+ if illustration and illustration.has_data():
+ return illustration
+ if IInternalLink.providedBy(context):
+ target = context.get_target()
+ if target is not None:
+ illustration = request.registry.queryMultiAdapter((target, request),
+ IContentNavigationIllustration)
+ if illustration and illustration.has_data():
+ return illustration
+
+
+@adapter_config(name='pyams_illustration',
+ context=(Interface, Interface, Interface),
+ provides=ITALESExtension)
+class PyAMSContentIllustrationTALESExtension(ContextRequestViewAdapter):
+ """PyAMS content illustration TALES extension"""
+
+ def render(self, context=None):
+ if context is None:
+ context = self.context
+ return self.request.registry.queryMultiAdapter((context, self.request), IContentNavigationIllustration)
+
+
+@adapter_config(context=(ISiteRoot, IPyAMSLayer), provides=IContentHeaderIllustration)
+@adapter_config(context=(IBaseContent, IPyAMSLayer), provides=IContentHeaderIllustration)
+def base_content_header_illustration_adapter(context, request):
+ """Base content header illustration adapter"""
+ illustration = IIllustration(context, None)
+ if illustration and illustration.has_data():
+ return illustration
#
@@ -62,7 +104,7 @@
class BaseIllustrationRenderer(BaseContentRenderer):
"""Base illustration renderer"""
- context_attrs = ('author', )
+ context_attrs = ('author',)
i18n_context_attrs = ('title', 'alt_title', 'description', 'data')
position = None
--- a/src/pyams_default_theme/component/paragraph/interfaces/verbatim.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/interfaces/verbatim.py Fri Oct 05 14:10:51 2018 +0200
@@ -24,7 +24,6 @@
from pyams_default_theme import _
-
FRAME_POSITIONS = (
{'id': 'left', 'title': _("Left")},
{'id': 'right', 'title': _("Right")},
@@ -59,4 +58,4 @@
"given as columns count; full width counts for 12 columns"),
required=True,
values=list(range(1, 13)),
- default=4)
+ default=6)
--- a/src/pyams_default_theme/component/paragraph/map.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/map.py Fri Oct 05 14:10:51 2018 +0200
@@ -13,12 +13,13 @@
__docformat__ = 'restructuredtext'
-from pyams_content.component.paragraph.interfaces.map import have_gis, IMapParagraph
+from pyams_content.component.paragraph.interfaces.map import have_gis
if have_gis:
# import standard library
# import interfaces
+ from pyams_content.component.paragraph.interfaces.map import IMapParagraph
from pyams_content.features.renderer.interfaces import IContentRenderer
from pyams_default_theme.component.paragraph.interfaces.map import IMapParagraphDefaultRendererSettings
from pyams_gis.interfaces.configuration import IMapConfiguration
--- a/src/pyams_default_theme/component/paragraph/milestone.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/milestone.py Fri Oct 05 14:10:51 2018 +0200
@@ -18,15 +18,13 @@
# import interfaces
from pyams_content.component.paragraph.interfaces.milestone import IMilestoneParagraph
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_default_theme import _
+from pyams_skin.layer import IPyAMSLayer
from pyams_template.template import template_config
from pyams_utils.adapter import adapter_config
-from pyams_default_theme import _
-
#
# Milestone paragraph default renderer
--- a/src/pyams_default_theme/component/paragraph/portlet/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/portlet/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -17,11 +17,12 @@
from zope.interface import Interface
-from pyams_content import _
# import interfaces
from pyams_content.component.paragraph.interfaces import IParagraphContainer
-from pyams_content.component.paragraph.portlet.interfaces import IParagraphContainerPortletSettings
+from pyams_content.component.paragraph.portlet.interfaces import IParagraphContainerPortletSettings, \
+ IParagraphNavigationPortletSettings
from pyams_content.features.renderer.interfaces import ISharedContentRenderer
+from pyams_default_theme import _
from pyams_portal.interfaces import IPortalContext, IPortletRenderer
# import packages
from pyams_portal.portlet import PortletRenderer
@@ -55,3 +56,22 @@
key=lambda x: x[1].weight)]
self.renderers = list(filter(lambda x: x is not None, renderers))
[renderer.update() for renderer in self.renderers]
+
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, IParagraphNavigationPortletSettings),
+ provides=IPortletRenderer)
+@template_config(template='templates/navigation.pt', layer=IPyAMSLayer)
+class ParagraphNavigationPortletRenderer(PortletRenderer):
+ """Paragraphs navigation default portlet renderer"""
+
+ label = _("Default paragraphs navigation")
+
+ paragraphs = ()
+
+ def update(self):
+ super(ParagraphNavigationPortletRenderer, self).update()
+ settings = self.settings
+ container = IParagraphContainer(self.context, None)
+ if container is not None:
+ self.paragraphs = container.get_visible_paragraphs(settings.paragraphs, settings.anchors_only,
+ settings.factories)
--- a/src/pyams_default_theme/component/paragraph/portlet/templates/content.pt Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/portlet/templates/content.pt Fri Oct 05 14:10:51 2018 +0200
@@ -1,7 +1,9 @@
<div class="edito"
tal:condition="view.renderers">
<tal:loop repeat="renderer view.renderers">
- <tal:if condition="renderer"
- content="structure renderer.render()">Renderer</tal:if>
+ <tal:if condition="renderer is not None">
+ <a id="part_${tales:cache_key(renderer.context)}"></a>
+ ${structure:renderer.render()}
+ </tal:if>
</tal:loop>
</div>
--- a/src/pyams_default_theme/component/paragraph/verbatim.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/verbatim.py Fri Oct 05 14:10:51 2018 +0200
@@ -15,26 +15,23 @@
# import standard library
from persistent import Persistent
+from zope.interface import implementer
+from zope.location import Location
+from zope.schema.fieldproperty import FieldProperty
# import interfaces
from pyams_content.component.illustration.interfaces import IIllustration
from pyams_content.component.paragraph.interfaces.verbatim import IVerbatimParagraph
from pyams_content.features.renderer.interfaces import IContentRenderer
+# import packages
+from pyams_content.features.renderer.skin import BaseContentRenderer
+from pyams_default_theme import _
from pyams_default_theme.component.paragraph.interfaces.verbatim import IVerbatimParagraphRendererSettings, \
ILateralVerbatimParagraphRendererSettings, IDefaultVerbatimParagraphRendererSettings
from pyams_i18n.interfaces import II18n
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, get_annotation_adapter
-from zope.interface import implementer
-from zope.location import Location
-from zope.schema.fieldproperty import FieldProperty
-
-from pyams_default_theme import _
-
#
# Verbatim paragraph default renderer settings
--- a/src/pyams_default_theme/component/paragraph/zmi/map.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/zmi/map.py Fri Oct 05 14:10:51 2018 +0200
@@ -56,12 +56,12 @@
AdminDialogEditForm.updateActions(self.view)
def updateGroups(self):
- view = self.view
- view.add_group(NamedWidgetsGroup(view, 'configuration', view.widgets,
- view.fields.keys(),
+ form = self.view
+ form.add_group(NamedWidgetsGroup(form, 'configuration', form.widgets,
+ form.fields.keys(),
legend=_("Don't use default map configuration"),
css_class='inner',
switch=True,
checkbox_switch=True,
checkbox_field=IMapParagraphDefaultRendererSettings['no_use_default_map_configuration']))
- AdminDialogEditForm.updateGroups(view)
+ AdminDialogEditForm.updateGroups(form)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/features/alert/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2008-2018 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'
+
+from zope.interface import Interface
+
+from pyams_content.features.alert.interfaces import IAlertContainer, ALERT_GRAVITY_NAMES
+from pyams_skin.layer import IPyAMSUserLayer
+from pyams_template.template import template_config
+from pyams_viewlet.viewlet import ViewContentProvider, contentprovider_config
+
+
+@contentprovider_config(name='pyams.alerts', layer=IPyAMSUserLayer, view=Interface)
+@template_config(template='templates/alerts.pt', layer=IPyAMSUserLayer)
+class AlertsContentProvider(ViewContentProvider):
+ """Alerts content provider"""
+
+ def get_alerts(self):
+ alerts = IAlertContainer(self.request.root, None)
+ if alerts is not None:
+ yield from alerts.get_visible_items()
+
+ def get_gravity(self, alert):
+ return self.request.localizer.translate(ALERT_GRAVITY_NAMES.get(alert.gravity))
--- a/src/pyams_default_theme/features/menu/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/features/menu/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -11,28 +11,3 @@
#
__docformat__ = 'restructuredtext'
-
-
-# import standard library
-
-# import interfaces
-from pyams_content.component.illustration import IBasicIllustration
-from pyams_content.component.links.interfaces import IBaseLink, IInternalLink
-from pyams_default_theme.interfaces import IContentNavigationIllustration
-from pyams_skin.layer import IPyAMSLayer
-
-# import packages
-from pyams_utils.adapter import adapter_config
-
-
-@adapter_config(context=(IBaseLink, IPyAMSLayer), provides=IContentNavigationIllustration)
-def base_link_navigation_illustration_adapter(context, request):
- """Base link navigation illustration adapter"""
- illustration = IBasicIllustration(context, None)
- if not (illustration and illustration.has_data()):
- if IInternalLink.providedBy(context):
- target = context.get_target()
- if target is not None:
- illustration = request.registry.queryMultiAdapter((target, request),
- IContentNavigationIllustration)
- return illustration
--- a/src/pyams_default_theme/interfaces/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/interfaces/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -12,12 +12,6 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
-
-# import interfaces
-
-# import packages
from zope.interface import Interface
@@ -33,5 +27,9 @@
"""Content date interface"""
+class IContentHeaderIllustration(Interface):
+ """Content header illustration adapter interface"""
+
+
class IContentNavigationIllustration(Interface):
- """Content navigation illustration"""
+ """Content navigation illustration adapter interface"""
Binary file src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.mo has changed
--- a/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/locales/fr/LC_MESSAGES/pyams_default_theme.po Fri Oct 05 14:10:51 2018 +0200
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-09-05 09:17+0200\n"
+"POT-Creation-Date: 2018-09-25 11:23+0200\n"
"PO-Revision-Date: 2017-06-07 12:41+0200\n"
"Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
"Language-Team: French\n"
@@ -20,6 +20,10 @@
msgid "PyAMS default skin"
msgstr "Skin par défaut (PyAMS)"
+#: src/pyams_default_theme/component/gallery/__init__.py:34
+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"
@@ -32,77 +36,176 @@
msgid "Vertical list"
msgstr "Liste verticale"
-#: src/pyams_default_theme/component/gallery/__init__.py:40
-msgid "Default gallery renderer"
+#: 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:87
+msgid "Small illustration on the left"
+msgstr "Illustration sur la gauche"
+
+#: 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/__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: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 "
+"zoomer sur l'image"
+
+#: src/pyams_default_theme/component/paragraph/milestone.py:38
+msgid "Default milestones renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/component/paragraph/keypoint.py:40
+msgid "Default key points renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/component/paragraph/map.py:96
+msgid "Default map renderer"
msgstr "Par défaut"
+#: src/pyams_default_theme/component/paragraph/video.py:40
#: src/pyams_default_theme/component/video/__init__.py:41
-#: src/pyams_default_theme/component/paragraph/video.py:40
msgid "Default video renderer"
msgstr "Par défaut"
+#: src/pyams_default_theme/component/paragraph/pictogram.py:40
+msgid "Default pictograms renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/component/paragraph/audio.py:40
+msgid "Default audio renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/component/paragraph/frame.py:164
+msgid "Default frame renderer"
+msgstr "Encadré en pleine largeur (par défaut)"
+
+#: src/pyams_default_theme/component/paragraph/frame.py:175
+#: src/pyams_default_theme/component/paragraph/verbatim.py:114
+msgid "Small frame on the left"
+msgstr "Encadré placé sur la gauche"
+
+#: src/pyams_default_theme/component/paragraph/frame.py:186
+#: src/pyams_default_theme/component/paragraph/verbatim.py:125
+msgid "Small frame on the right"
+msgstr "Encadré placé sur la droite"
+
+#: src/pyams_default_theme/component/paragraph/verbatim.py:103
+msgid "Default verbatim renderer"
+msgstr "Encadré en pleine largeur (par défaut)"
+
+#: src/pyams_default_theme/component/paragraph/html.py:39
+msgid "Default raw HTML renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/component/paragraph/html.py:53
+msgid "Default rich text renderer"
+msgstr "Par défaut"
+
#: src/pyams_default_theme/component/paragraph/contact.py:85
msgid "Default contact renderer"
msgstr "Encadré en pleine largeur (par défaut)"
-#: src/pyams_default_theme/component/paragraph/pictogram.py:40
-msgid "Default pictograms renderer"
+#: 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"
+
+#: src/pyams_default_theme/component/paragraph/portlet/__init__.py:40
+msgid "Default paragraphs renderer"
msgstr "Par défaut"
-#: src/pyams_default_theme/component/paragraph/milestone.py:40
-msgid "Default milestones renderer"
-msgstr "Par défaut"
-
-#: src/pyams_default_theme/component/paragraph/html.py:41
-msgid "Default raw HTML renderer"
-msgstr "Par défaut"
-
-#: src/pyams_default_theme/component/paragraph/html.py:55
-msgid "Default rich text renderer"
+#: src/pyams_default_theme/component/paragraph/portlet/__init__.py:67
+msgid "Default paragraphs navigation"
msgstr "Par défaut"
-#: src/pyams_default_theme/component/paragraph/verbatim.py:115
-msgid "Default verbatim renderer"
-msgstr "Encadré en pleine largeur (par défaut)"
-
-#: src/pyams_default_theme/component/paragraph/verbatim.py:126
-#: src/pyams_default_theme/component/paragraph/frame.py:175
-msgid "Small frame on the left"
-msgstr "Encadré placé sur la gauche"
-
-#: src/pyams_default_theme/component/paragraph/verbatim.py:137
-#: src/pyams_default_theme/component/paragraph/frame.py:186
-msgid "Small frame on the right"
-msgstr "Encadré placé sur la droite"
+#: src/pyams_default_theme/component/paragraph/interfaces/map.py:34
+msgid "Don't use default configuration?"
+msgstr "Ne pas utiliser la configuration par défaut ?"
-#: src/pyams_default_theme/component/paragraph/map.py:95
-msgid "Default map renderer"
-msgstr "Par défaut"
-
-#: src/pyams_default_theme/component/paragraph/keypoint.py:40
-msgid "Default key points renderer"
-msgstr "Par défaut"
+#: src/pyams_default_theme/component/paragraph/interfaces/map.py:38
+msgid "Use default configuration?"
+msgstr "Utiliser la configuration par défaut ?"
-#: src/pyams_default_theme/component/paragraph/frame.py:164
-msgid "Default frame renderer"
-msgstr "Encadré en pleine largeur (par défaut)"
-
-#: src/pyams_default_theme/component/paragraph/audio.py:40
-msgid "Default audio renderer"
-msgstr "Par défaut"
-
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:30
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:28
#: src/pyams_default_theme/component/paragraph/interfaces/contact.py:29
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:29
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:30
msgid "Left"
msgstr "Gauche"
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:31
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:29
#: src/pyams_default_theme/component/paragraph/interfaces/contact.py:30
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:30
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:31
msgid "Right"
msgstr "Droite"
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:32
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:30
+msgid "Center (full width)"
+msgstr "Centré (pleine largeur)"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:42
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:40
+msgid "Show illustration?"
+msgstr "Afficher l'illustration ?"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:43
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:41
+msgid "If 'no', illustration will not be displayed"
+msgstr ""
+"Si 'non', l'illustration ne sera pas affichée même si un contenu a été fourni"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:50
+msgid "Show associations?"
+msgstr "Afficher les liens et pièces jointes ?"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:51
+msgid "If 'no', associations will not be displayed"
+msgstr ""
+"Si 'non', les liens et pièces jointes ne seront pas affichés même s'il "
+"existe des éléments visibles"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:58
+msgid "Pictogram"
+msgstr "Pictogramme"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:59
+msgid "Name of the pictogram associated with this frame paragraph"
+msgstr "Nom du pictogramme associé à cet encadré"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:73
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:56
+msgid "Relative width"
+msgstr "Largeur relative"
+
+#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:74
+msgid ""
+"Relative width used by this frame, relative to it's parent, given as columns "
+"count; full width counts for 12 columns"
+msgstr ""
+"Largeur relative de ce bloc par rapport au bloc dans lequel il s'intègre. Cette largeur "
+"est indiquée en nombre de colonnes, la largeur totale étant de 12 "
+"colonnes."
+
+#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:57
+msgid ""
+"Relative width used by this paragraph, relative to it's parent, given as "
+"columns count; full width counts for 12 columns"
+msgstr ""
+"Largeur relative de ce bloc par rapport au bloc dans lequel il s'intègre. Cette largeur "
+"est indiquée en nombre de colonnes, la largeur totale étant de 12 "
+"colonnes."
+
#: src/pyams_default_theme/component/paragraph/interfaces/contact.py:40
msgid "Show photo?"
msgstr "Afficher la photo ?"
@@ -131,114 +234,35 @@
msgid "Map position"
msgstr "Position de la carte"
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:31
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:32
-msgid "Center (full width)"
-msgstr "Centré (pleine largeur)"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:41
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:42
-msgid "Show illustration?"
-msgstr "Afficher l'illustration ?"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:42
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:43
-msgid "If 'no', illustration will not be displayed"
-msgstr ""
-"Si 'non', l'illustration ne sera pas affichée même si un contenu a été fourni"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:57
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:73
-msgid "Relative width"
-msgstr "Largeur relative"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:58
-msgid ""
-"Relative width used by this paragraph, relative to it's parent, given as "
-"columns count; full width counts for 12 columns"
-msgstr ""
-"Largeur relative de ce paragraphe par rapport à son parent. Cette largeur "
-"est indiquée en nombre de colonnes, la largeur totale correspondant à 12 "
-"colonnes."
-
-#: src/pyams_default_theme/component/paragraph/interfaces/map.py:34
-msgid "Don't use default configuration?"
-msgstr "Ne pas utiliser la configuration par défaut ?"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/map.py:38
-msgid "Use default configuration?"
-msgstr "Utiliser la configuration par défaut ?"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:50
-msgid "Show associations?"
-msgstr "Afficher les liens et pièces jointes ?"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:51
-msgid "If 'no', associations will not be displayed"
-msgstr ""
-"Si 'non', les liens et pièces jointes ne seront pas affichés même s'il existe des "
-"éléments visibles"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:58
-msgid "Pictogram"
-msgstr "Pictogramme"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:59
-msgid "Name of the pictogram associated with this frame paragraph"
-msgstr "Nom du pictogramme associé à cet encadré"
-
-#: src/pyams_default_theme/component/paragraph/interfaces/frame.py:74
-msgid ""
-"Relative width used by this frame, relative to it's parent, given as columns "
-"count; full width counts for 12 columns"
-msgstr ""
-"Largeur relative de ce paragraphe par rapport à son parent. Cette largeur "
-"est indiquée en nombre de colonnes, la largeur totale correspondant à 12 "
-"colonnes."
-
-#: 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"
-
-#: src/pyams_default_theme/component/association/__init__.py:48
+#: src/pyams_default_theme/component/association/__init__.py:47
msgid "Default associations renderer"
msgstr "Par défaut"
-#: src/pyams_default_theme/component/association/__init__.py:89
+#: src/pyams_default_theme/component/association/__init__.py:88
msgid "Include remote content"
msgstr "Include les blocs de contenu distants"
-#: src/pyams_default_theme/component/association/interfaces/__init__.py:31
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:30
msgid "Display title?"
msgstr "Afficher le titre ?"
-#: src/pyams_default_theme/component/association/interfaces/__init__.py:32
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:31
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
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:35
msgid "Display header?"
msgstr "Afficher le chapô ?"
-#: src/pyams_default_theme/component/association/interfaces/__init__.py:37
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:36
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
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:40
msgid "Paragraph types"
msgstr "Types de blocs"
-#: src/pyams_default_theme/component/association/interfaces/__init__.py:47
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:41
msgid ""
"Select list of paragraph types you want to include; an empty selection means "
"that all paragraphs will be selected"
@@ -246,47 +270,53 @@
"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/component/illustration/__init__.py:76
-msgid "Centered illustration before text"
-msgstr "Illustration centrée avant le texte"
+#: src/pyams_default_theme/component/association/interfaces/__init__.py:46
+msgid "Anchors only?"
+msgstr "Ancres seulement ?"
-#: 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/association/interfaces/__init__.py:47
+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/illustration/__init__.py:99
-msgid "Small illustration on the right"
-msgstr "Illustration sur la droite"
+#: src/pyams_default_theme/shared/common/portlet/title.py:38
+msgid "Default title renderer"
+msgstr "Par défaut"
-#: 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/shared/common/portlet/head.py:38
+msgid "Default header renderer"
+msgstr "Par défaut"
-#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:41
-msgid "Zoom on click?"
-msgstr "Zoom sur clic ?"
+#: src/pyams_default_theme/shared/view/templates/render.pt:2
+msgid "View result items"
+msgstr "Aperçu du contenu de la vue"
-#: src/pyams_default_theme/component/illustration/interfaces/__init__.py:42
-msgid "If 'yes', a click on illustration thumbnail is required to zoom"
+#: src/pyams_default_theme/shared/view/templates/render.pt:3
+msgid "WARNING: items displayed in this preview are out of context!!"
msgstr ""
-"Si 'oui', un clic sur la vignette de l'illustration est nécessaire pour "
-"zoomer sur l'image"
+"ATTENTION : la sélection des éléments affichés dans cet aperçu ne tient pas "
+"compte du contexte éventuellement paramétré dans la vue"
-#: src/pyams_default_theme/features/footer/interfaces.py:31
-msgid "Copyright"
-msgstr "Copyright"
+#: src/pyams_default_theme/shared/view/portlet/__init__.py:38
+msgid "Simple vertical view"
+msgstr "Liste verticale simple"
-#: src/pyams_default_theme/features/footer/interfaces.py:32
-msgid "Copyright mention displayed in page footer"
-msgstr "Mention affichée dans le pied de page"
+#: src/pyams_default_theme/shared/imagemap/__init__.py:58
+msgid "Default imagemap renderer"
+msgstr "Par défaut"
+
+#: src/pyams_default_theme/shared/imagemap/templates/render.pt:2
+msgid "Image map preview"
+msgstr "Aperçu des zones cliquables"
-#: src/pyams_default_theme/features/footer/zmi/__init__.py:64
-msgid "Footer links"
-msgstr "Liens du pied de page"
+#: src/pyams_default_theme/shared/logo/__init__.py:39
+msgid "Default logos renderer"
+msgstr "Par défaut"
-#: src/pyams_default_theme/features/footer/skin/__init__.py:50
-msgid "PyAMS simple footer with links"
-msgstr "PyAMS: pied de page simple avec liens"
+#: src/pyams_default_theme/viewlet/logo/templates/logo.pt:5
+msgid "Back home"
+msgstr "Revenir à l'accueil"
#: src/pyams_default_theme/features/menu/portlet/navigation/__init__.py:49
msgid "Horizontal list with vertical illustrations"
@@ -320,6 +350,22 @@
msgid "Label associated with second level options menu"
msgstr "Libellé associé au second niveau de sélection"
+#: src/pyams_default_theme/features/footer/interfaces.py:31
+msgid "Copyright"
+msgstr "Copyright"
+
+#: src/pyams_default_theme/features/footer/interfaces.py:32
+msgid "Copyright mention displayed in page footer"
+msgstr "Mention affichée dans le pied de page"
+
+#: src/pyams_default_theme/features/footer/zmi/__init__.py:64
+msgid "Footer links"
+msgstr "Liens du pied de page"
+
+#: src/pyams_default_theme/features/footer/skin/__init__.py:50
+msgid "PyAMS simple footer with links"
+msgstr "PyAMS: pied de page simple avec liens"
+
#: src/pyams_default_theme/features/header/interfaces.py:31
msgid "Banner image"
msgstr "Bandeau"
@@ -344,39 +390,6 @@
msgid "PyAMS simple header with banner and tabs"
msgstr "PyAMS: en-tête simple avec bandeau et onglets de navigation"
-#: src/pyams_default_theme/shared/view/portlet/__init__.py:38
-msgid "Simple vertical view"
-msgstr "Liste verticale simple"
-
-#: src/pyams_default_theme/shared/view/templates/render.pt:2
-msgid "View result items"
-msgstr "Aperçu du contenu de la vue"
-
-#: src/pyams_default_theme/shared/view/templates/render.pt:3
-msgid "WARNING: items displayed in this preview are out of context!!"
-msgstr ""
-"ATTENTION : la sélection des éléments affichés dans cet aperçu ne tient pas "
-"compte du contexte éventuellement paramétré dans la vue"
-
-#: src/pyams_default_theme/shared/imagemap/__init__.py:58
-msgid "Default imagemap renderer"
-msgstr "Par défaut"
-
-#: src/pyams_default_theme/shared/imagemap/templates/render.pt:2
-msgid "Image map preview"
-msgstr "Aperçu des zones cliquables"
-
-#: src/pyams_default_theme/shared/logo/__init__.py:39
-msgid "Default logos renderer"
-msgstr "Par défaut"
-
-#: src/pyams_default_theme/viewlet/logo/templates/logo.pt:5
-msgid "Back home"
-msgstr "Revenir à l'accueil"
-
-#~ msgid "Default header renderer"
-#~ msgstr "Par défaut"
-
#~ msgid "Search..."
#~ msgstr "Chercher..."
--- a/src/pyams_default_theme/locales/pyams_default_theme.pot Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/locales/pyams_default_theme.pot Fri Oct 05 14:10:51 2018 +0200
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-09-05 09:17+0200\n"
+"POT-Creation-Date: 2018-09-25 11:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -20,6 +20,10 @@
msgid "PyAMS default skin"
msgstr ""
+#: ./src/pyams_default_theme/component/gallery/__init__.py:34
+msgid "Default gallery renderer"
+msgstr ""
+
#: ./src/pyams_default_theme/component/keynumber/__init__.py:53
msgid "Default key numbers renderer"
msgstr ""
@@ -32,75 +36,163 @@
msgid "Vertical list"
msgstr ""
-#: ./src/pyams_default_theme/component/gallery/__init__.py:40
-msgid "Default gallery renderer"
+#: ./src/pyams_default_theme/component/illustration/__init__.py:76
+msgid "Centered illustration before text"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/illustration/__init__.py:87
+msgid "Small illustration on the left"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/illustration/__init__.py:99
+msgid "Small illustration on the right"
+msgstr ""
+
+#: ./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/video/__init__.py:41
-#: ./src/pyams_default_theme/component/paragraph/video.py:40
-msgid "Default video renderer"
+#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:42
+msgid "If 'yes', a click on illustration thumbnail is required to zoom"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/milestone.py:38
+msgid "Default milestones renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/paragraph/contact.py:85
-msgid "Default contact renderer"
+#: ./src/pyams_default_theme/component/paragraph/keypoint.py:40
+msgid "Default key points renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/map.py:96
+msgid "Default map renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/video.py:40
+#: ./src/pyams_default_theme/component/video/__init__.py:41
+msgid "Default video renderer"
msgstr ""
#: ./src/pyams_default_theme/component/paragraph/pictogram.py:40
msgid "Default pictograms renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/paragraph/milestone.py:40
-msgid "Default milestones renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/html.py:41
-msgid "Default raw HTML renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/html.py:55
-msgid "Default rich text renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/verbatim.py:115
-msgid "Default verbatim renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/verbatim.py:126
-#: ./src/pyams_default_theme/component/paragraph/frame.py:175
-msgid "Small frame on the left"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/verbatim.py:137
-#: ./src/pyams_default_theme/component/paragraph/frame.py:186
-msgid "Small frame on the right"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/map.py:95
-msgid "Default map renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/keypoint.py:40
-msgid "Default key points renderer"
+#: ./src/pyams_default_theme/component/paragraph/audio.py:40
+msgid "Default audio renderer"
msgstr ""
#: ./src/pyams_default_theme/component/paragraph/frame.py:164
msgid "Default frame renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/paragraph/audio.py:40
-msgid "Default audio renderer"
+#: ./src/pyams_default_theme/component/paragraph/frame.py:175
+#: ./src/pyams_default_theme/component/paragraph/verbatim.py:114
+msgid "Small frame on the left"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/frame.py:186
+#: ./src/pyams_default_theme/component/paragraph/verbatim.py:125
+msgid "Small frame on the right"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/verbatim.py:103
+msgid "Default verbatim renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/html.py:39
+msgid "Default raw HTML renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/html.py:53
+msgid "Default rich text renderer"
msgstr ""
+#: ./src/pyams_default_theme/component/paragraph/contact.py:85
+msgid "Default contact renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/zmi/map.py:62
+msgid "Don't use default map configuration"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/portlet/__init__.py:40
+msgid "Default paragraphs renderer"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/portlet/__init__.py:67
+msgid "Default paragraphs navigation"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/map.py:34
+msgid "Don't use default configuration?"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/map.py:38
+msgid "Use default configuration?"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:30
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:28
#: ./src/pyams_default_theme/component/paragraph/interfaces/contact.py:29
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:29
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:30
msgid "Left"
msgstr ""
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:31
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:29
#: ./src/pyams_default_theme/component/paragraph/interfaces/contact.py:30
+msgid "Right"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:32
#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:30
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:31
-msgid "Right"
+msgid "Center (full width)"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:42
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:40
+msgid "Show illustration?"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:43
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:41
+msgid "If 'no', illustration will not be displayed"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:50
+msgid "Show associations?"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:51
+msgid "If 'no', associations will not be displayed"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:58
+msgid "Pictogram"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:59
+msgid "Name of the pictogram associated with this frame paragraph"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:73
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:56
+msgid "Relative width"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:74
+msgid ""
+"Relative width used by this frame, relative to it's parent, given as columns "
+"count; full width counts for 12 columns"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:57
+msgid ""
+"Relative width used by this paragraph, relative to it's parent, given as "
+"columns count; full width counts for 12 columns"
msgstr ""
#: ./src/pyams_default_theme/component/paragraph/interfaces/contact.py:40
@@ -127,146 +219,82 @@
msgid "Map position"
msgstr ""
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:31
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:32
-msgid "Center (full width)"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:41
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:42
-msgid "Show illustration?"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:42
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:43
-msgid "If 'no', illustration will not be displayed"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:57
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:73
-msgid "Relative width"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/verbatim.py:58
-msgid ""
-"Relative width used by this paragraph, relative to it's parent, given as "
-"columns count; full width counts for 12 columns"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/map.py:34
-msgid "Don't use default configuration?"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/map.py:38
-msgid "Use default configuration?"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:50
-msgid "Show associations?"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:51
-msgid "If 'no', associations will not be displayed"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:58
-msgid "Pictogram"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:59
-msgid "Name of the pictogram associated with this frame paragraph"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/interfaces/frame.py:74
-msgid ""
-"Relative width used by this frame, relative to it's parent, given as columns "
-"count; full width counts for 12 columns"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/paragraph/zmi/map.py:62
-msgid "Don't use default map configuration"
-msgstr ""
-
-#: ./src/pyams_default_theme/component/association/__init__.py:48
+#: ./src/pyams_default_theme/component/association/__init__.py:47
msgid "Default associations renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/association/__init__.py:89
+#: ./src/pyams_default_theme/component/association/__init__.py:88
msgid "Include remote content"
msgstr ""
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:30
+msgid "Display title?"
+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
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:35
msgid "Display header?"
msgstr ""
-#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:37
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:36
msgid "Choose 'yes' to display remote content's header"
msgstr ""
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:40
+msgid "Paragraph types"
+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/component/illustration/__init__.py:76
-msgid "Centered illustration before text"
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:46
+msgid "Anchors only?"
+msgstr ""
+
+#: ./src/pyams_default_theme/component/association/interfaces/__init__.py:47
+msgid "If 'yes', only paragraphs set as 'anchors' will be selected"
msgstr ""
-#: ./src/pyams_default_theme/component/illustration/__init__.py:87
-msgid "Small illustration on the left"
+#: ./src/pyams_default_theme/shared/common/portlet/title.py:38
+msgid "Default title renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/illustration/__init__.py:99
-msgid "Small illustration on the right"
+#: ./src/pyams_default_theme/shared/common/portlet/head.py:38
+msgid "Default header renderer"
msgstr ""
-#: ./src/pyams_default_theme/component/illustration/__init__.py:111
-msgid "Centered illustration after text"
+#: ./src/pyams_default_theme/shared/view/templates/render.pt:2
+msgid "View result items"
msgstr ""
-#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:41
-msgid "Zoom on click?"
+#: ./src/pyams_default_theme/shared/view/templates/render.pt:3
+msgid "WARNING: items displayed in this preview are out of context!!"
msgstr ""
-#: ./src/pyams_default_theme/component/illustration/interfaces/__init__.py:42
-msgid "If 'yes', a click on illustration thumbnail is required to zoom"
+#: ./src/pyams_default_theme/shared/view/portlet/__init__.py:38
+msgid "Simple vertical view"
msgstr ""
-#: ./src/pyams_default_theme/features/footer/interfaces.py:31
-msgid "Copyright"
+#: ./src/pyams_default_theme/shared/imagemap/__init__.py:58
+msgid "Default imagemap renderer"
msgstr ""
-#: ./src/pyams_default_theme/features/footer/interfaces.py:32
-msgid "Copyright mention displayed in page footer"
+#: ./src/pyams_default_theme/shared/imagemap/templates/render.pt:2
+msgid "Image map preview"
msgstr ""
-#: ./src/pyams_default_theme/features/footer/zmi/__init__.py:64
-msgid "Footer links"
+#: ./src/pyams_default_theme/shared/logo/__init__.py:39
+msgid "Default logos renderer"
msgstr ""
-#: ./src/pyams_default_theme/features/footer/skin/__init__.py:50
-msgid "PyAMS simple footer with links"
+#: ./src/pyams_default_theme/viewlet/logo/templates/logo.pt:5
+msgid "Back home"
msgstr ""
#: ./src/pyams_default_theme/features/menu/portlet/navigation/__init__.py:49
@@ -301,6 +329,22 @@
msgid "Label associated with second level options menu"
msgstr ""
+#: ./src/pyams_default_theme/features/footer/interfaces.py:31
+msgid "Copyright"
+msgstr ""
+
+#: ./src/pyams_default_theme/features/footer/interfaces.py:32
+msgid "Copyright mention displayed in page footer"
+msgstr ""
+
+#: ./src/pyams_default_theme/features/footer/zmi/__init__.py:64
+msgid "Footer links"
+msgstr ""
+
+#: ./src/pyams_default_theme/features/footer/skin/__init__.py:50
+msgid "PyAMS simple footer with links"
+msgstr ""
+
#: ./src/pyams_default_theme/features/header/interfaces.py:31
msgid "Banner image"
msgstr ""
@@ -324,31 +368,3 @@
#: ./src/pyams_default_theme/features/header/skin/__init__.py:52
msgid "PyAMS simple header with banner and tabs"
msgstr ""
-
-#: ./src/pyams_default_theme/shared/view/portlet/__init__.py:38
-msgid "Simple vertical view"
-msgstr ""
-
-#: ./src/pyams_default_theme/shared/view/templates/render.pt:2
-msgid "View result items"
-msgstr ""
-
-#: ./src/pyams_default_theme/shared/view/templates/render.pt:3
-msgid "WARNING: items displayed in this preview are out of context!!"
-msgstr ""
-
-#: ./src/pyams_default_theme/shared/imagemap/__init__.py:58
-msgid "Default imagemap renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/shared/imagemap/templates/render.pt:2
-msgid "Image map preview"
-msgstr ""
-
-#: ./src/pyams_default_theme/shared/logo/__init__.py:39
-msgid "Default logos renderer"
-msgstr ""
-
-#: ./src/pyams_default_theme/viewlet/logo/templates/logo.pt:5
-msgid "Back home"
-msgstr ""
--- a/src/pyams_default_theme/shared/common/__init__.py Thu Sep 06 18:14:22 2018 +0200
+++ b/src/pyams_default_theme/shared/common/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -12,25 +12,19 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
+from zope.interface import Interface
-# import interfaces
-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, \
- IContentNavigationIllustration
+from pyams_default_theme.interfaces import IContentDate, IContentNavigationTitle, \
+ IContentTag
from pyams_i18n.interfaces import II18n
from pyams_skin.layer import IPyAMSLayer
+from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config
+from pyams_utils.date import SH_DATE_FORMAT, format_date
from pyams_utils.interfaces.tales import ITALESExtension
from pyams_workflow.interfaces import IWorkflowPublicationInfo
-# import packages
-from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
-from pyams_utils.date import format_date, SH_DATE_FORMAT
-from zope.interface import Interface
-
@adapter_config(context=(IBaseContent, IPyAMSLayer), provides=IContentNavigationTitle)
def shared_content_navigation_title(context, request):
@@ -88,26 +82,3 @@
if context is None:
context = self.context
return self.request.registry.queryMultiAdapter((context, self.request), IContentDate)
-
-
-@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)
- if not (illustration and illustration.has_data()):
- illustration = IIllustration(context, None)
- if illustration and illustration.has_data():
- return illustration
-
-
-@adapter_config(name='pyams_illustration',
- context=(Interface, Interface, Interface),
- provides=ITALESExtension)
-class PyAMSContentIllustrationTALESExtension(ContextRequestViewAdapter):
- """PyAMS content illustration TALES extension"""
-
- def render(self, context=None):
- if context is None:
- context = self.context
- return self.request.registry.queryMultiAdapter((context, self.request), IContentNavigationIllustration)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/common/portlet/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,20 @@
+#
+# Copyright (c) 2008-2018 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
+
+# import packages
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/common/portlet/head.py Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,38 @@
+
+# Copyright (c) 2008-2018 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.shared.common.portlet.interfaces import ISharedContentHeaderPortletSettings
+from pyams_portal.interfaces import IPortalContext, IPortletRenderer
+from pyams_skin.layer import IPyAMSLayer
+
+# import packages
+from pyams_portal.portlet import PortletRenderer
+from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
+from zope.interface import Interface
+
+from pyams_default_theme import _
+
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISharedContentHeaderPortletSettings),
+ provides=IPortletRenderer)
+@template_config(template='templates/head.pt', layer=IPyAMSLayer)
+class SharedContentHeaderPortletRenderer(PortletRenderer):
+ """Shared content header portlet renderer"""
+
+ label = _("Default header renderer")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/shared/common/portlet/title.py Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,37 @@
+
+# Copyright (c) 2008-2018 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
+
+from zope.interface import Interface
+
+# import interfaces
+from pyams_content.shared.common.portlet.interfaces import ISharedContentTitlePortletSettings
+from pyams_default_theme import _
+from pyams_portal.interfaces import IPortalContext, IPortletRenderer
+# import packages
+from pyams_portal.portlet import PortletRenderer
+from pyams_skin.layer import IPyAMSLayer
+from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
+
+
+@adapter_config(context=(IPortalContext, IPyAMSLayer, Interface, ISharedContentTitlePortletSettings),
+ provides=IPortletRenderer)
+@template_config(template='templates/title.pt', layer=IPyAMSLayer)
+class SharedContentTitlePortletRenderer(PortletRenderer):
+ """Shared content title portlet renderer"""
+
+ label = _("Default title renderer")
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/viewlet/tag/__init__.py Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,51 @@
+#
+# Copyright (c) 2008-2018 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'
+
+from pyramid.decorator import reify
+from zope.interface import Interface
+
+from pyams_content.component.theme import ITagsInfo, ITagsManager
+from pyams_sequence.reference import get_reference_target
+from pyams_skin.layer import IPyAMSLayer, IPyAMSUserLayer
+from pyams_template.template import template_config
+from pyams_viewlet.viewlet import ViewContentProvider, contentprovider_config
+
+
+@contentprovider_config(name='pyams.tags', layer=IPyAMSUserLayer, view=Interface)
+@template_config(template='templates/tags.pt', layer=IPyAMSLayer)
+class TagsContentProvider(ViewContentProvider):
+ """Tags content provider"""
+
+ tags_info = None
+
+ def update(self):
+ super(TagsContentProvider, self).update()
+ self.tags_info = ITagsInfo(self.context, None)
+
+ def render(self):
+ if self.tags_info is None:
+ return ''
+ return super(TagsContentProvider, self).render()
+
+ @reify
+ def search_target(self):
+ manager = ITagsManager(self.request.root, None)
+ if (manager is not None) and manager.enable_tags_search and manager.tags_search_target:
+ return get_reference_target(manager.tags_search_target)
+
+ @property
+ def tags(self):
+ tags = self.tags_info.tags or ()
+ yield from sorted(tags, key=lambda x: (x.order or 999, x.alt or x.label))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_default_theme/viewlet/tag/templates/tags.pt Fri Oct 05 14:10:51 2018 +0200
@@ -0,0 +1,12 @@
+<div i18n:domain="pyams_default_theme"
+ tal:define="target view.search_target">
+ <tal:loop repeat="tag view.tags">
+ <span class="label label-primary">
+ <a tal:omit-tag="target is None"
+ tal:define="href tales:absolute_url(target)"
+ href="${href}/++tag++${tag.label}">
+ ${tag.alt or tag.label}
+ </a>
+ </span>
+ </tal:loop>
+</div>
\ No newline at end of file