# HG changeset patch # User Thierry Florac # Date 1539332926 -7200 # Node ID 97e8610cbabd13f76f447044d1d9bd5376b1d7b3 # Parent 610811d72a1006b50684edd47cd9bd7300b223ee# Parent e5d91569642f8840eadb21f3d8e825bc37f3a921 Merge branch dev-dc diff -r e5d91569642f -r 97e8610cbabd src/pyams_default_theme/component/association/__init__.py --- a/src/pyams_default_theme/component/association/__init__.py Tue Oct 09 17:51:18 2018 +0200 +++ b/src/pyams_default_theme/component/association/__init__.py Fri Oct 12 10:28:46 2018 +0200 @@ -12,29 +12,25 @@ __docformat__ = 'restructuredtext' - -# import standard library - -# import packages 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.association.interfaces import IAssociationParagraph, IAssociationInfo, \ - IAssociationContainer +from pyams_content.component.association.interfaces import IAssociationContainer, IAssociationInfo, \ + IAssociationParagraph from pyams_content.component.extfile import IExtFile -from pyams_content.component.links.interfaces import IInternalLink, IBaseLink -from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer +from pyams_content.component.links.interfaces import IBaseLink, IInternalLink +from pyams_content.component.paragraph.interfaces import IParagraphContainer, IParagraphContainerTarget from pyams_content.features.renderer.interfaces import IContentRenderer from pyams_content.features.renderer.skin import BaseContentRenderer -from pyams_default_theme import _ from pyams_default_theme.component.association.interfaces import IAssociationParagraphRemoteContentRendererSettings from pyams_skin.layer import IPyAMSLayer from pyams_template.template import template_config from pyams_utils.adapter import adapter_config, get_annotation_adapter +from pyams_default_theme import _ + # # Associations paragraph default renderer @@ -46,16 +42,11 @@ """Associations paragraph default renderer""" label = _("Default associations renderer") - i18n_context_attrs = ('title', ) + i18n_context_attrs = ('title',) links = None attachments = None - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.attachments = [] - self.links = [] - def get_associations(self): yield from IAssociationContainer(self.context).get_visible_items(self.request) @@ -65,12 +56,15 @@ def update(self): super().update() + self.attachments = [] + self.links = [] for item in self.get_associations(): if IExtFile.providedBy(item): self.attachments.append(item) elif IBaseLink.providedBy(item): self.links.append(item) + # # Associations paragraph remote content renderer # @@ -101,8 +95,9 @@ """Associations container remote content renderer""" label = _("Include remote content") + weight = 10 - i18n_context_attrs = ('title', ) + i18n_context_attrs = ('title',) links = () settings_interface = IAssociationParagraphRemoteContentRendererSettings diff -r e5d91569642f -r 97e8610cbabd src/pyams_default_theme/component/association/templates/association-default.pt --- a/src/pyams_default_theme/component/association/templates/association-default.pt Tue Oct 09 17:51:18 2018 +0200 +++ b/src/pyams_default_theme/component/association/templates/association-default.pt Fri Oct 12 10:28:46 2018 +0200 @@ -1,4 +1,2 @@ - -

§ title

- ${structure:provider:pyams.association} -
+

§ title

+${structure:provider:pyams.associations} diff -r e5d91569642f -r 97e8610cbabd src/pyams_default_theme/component/association/templates/association-viewlet.pt --- a/src/pyams_default_theme/component/association/templates/association-viewlet.pt Tue Oct 09 17:51:18 2018 +0200 +++ b/src/pyams_default_theme/component/association/templates/association-viewlet.pt Fri Oct 12 10:28:46 2018 +0200 @@ -1,21 +1,33 @@ -