# HG changeset patch # User Thierry Florac # Date 1530170800 -7200 # Node ID 3bc0c516ed1a921e5a717fb400b5e42dab74328c # Parent 5e51a9ef1094710ececed44087c828ee48835b9c Version 0.1.12 diff -r 5e51a9ef1094 -r 3bc0c516ed1a buildout.cfg --- a/buildout.cfg Thu Jun 28 09:22:22 2018 +0200 +++ b/buildout.cfg Thu Jun 28 09:26:40 2018 +0200 @@ -84,4 +84,4 @@ eggs = pyams_content_es [test] [versions] -pyams_content_es = 0.1.11 +pyams_content_es = 0.1.12 diff -r 5e51a9ef1094 -r 3bc0c516ed1a docs/HISTORY.txt --- a/docs/HISTORY.txt Thu Jun 28 09:22:22 2018 +0200 +++ b/docs/HISTORY.txt Thu Jun 28 09:26:40 2018 +0200 @@ -1,6 +1,11 @@ History ======= +0.1.12 +------ + - updated video paragraph index info + - added audio paragraph index info + 0.1.11 ------ - updated ES themes index values diff -r 5e51a9ef1094 -r 3bc0c516ed1a setup.py --- a/setup.py Thu Jun 28 09:22:22 2018 +0200 +++ b/setup.py Thu Jun 28 09:26:40 2018 +0200 @@ -22,7 +22,7 @@ README = os.path.join(DOCS, 'README.txt') HISTORY = os.path.join(DOCS, 'HISTORY.txt') -version = '0.1.11' +version = '0.1.12' long_description = open(README).read() + '\n\n' + open(HISTORY).read() tests_require = [] diff -r 5e51a9ef1094 -r 3bc0c516ed1a src/pyams_content_es.egg-info/PKG-INFO --- a/src/pyams_content_es.egg-info/PKG-INFO Thu Jun 28 09:22:22 2018 +0200 +++ b/src/pyams_content_es.egg-info/PKG-INFO Thu Jun 28 09:26:40 2018 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyams-content-es -Version: 0.1.11 +Version: 0.1.12 Summary: PyAMS content interfaces and classes for ElasticSearch indexation Home-page: http://hg.ztfy.org/pyams/pyams_content_es Author: Thierry Florac @@ -24,6 +24,11 @@ History ======= + 0.1.12 + ------ + - updated video paragraph index info + - added audio paragraph index info + 0.1.11 ------ - updated ES themes index values diff -r 5e51a9ef1094 -r 3bc0c516ed1a src/pyams_content_es/component/paragraph.py --- a/src/pyams_content_es/component/paragraph.py Thu Jun 28 09:22:22 2018 +0200 +++ b/src/pyams_content_es/component/paragraph.py Thu Jun 28 09:26:40 2018 +0200 @@ -20,6 +20,7 @@ from pyams_content.component.illustration.interfaces import IIllustrationParagraph from pyams_content.component.paragraph.interfaces import IParagraphContainer, IParagraphContainerTarget, \ IBaseParagraph +from pyams_content.component.paragraph.interfaces.audio import IAudioParagraph from pyams_content.component.paragraph.interfaces.contact import IContactParagraph from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph from pyams_content.component.paragraph.interfaces.header import IHeaderParagraph @@ -120,6 +121,25 @@ return info +@adapter_config(context=IAudioParagraph, provides=IDocumentIndexInfo) +def audio_paragraph_index_info(paragraph): + """Audio paragraph index info""" + info = {} + manager = get_parent(paragraph, II18nManager) + for lang in manager.get_languages(): + for attr in ('title', 'description'): + value = getattr(paragraph, attr, {}).get(lang, '') + if value: + info[lang] = '{old}\n{value}'.format(old=info.get(lang, ''), + value=value) + for attr in ('author', ): + value = getattr(paragraph, attr, '') + if value: + info[lang] = '{old}\n{value}'.format(old=info.get(lang, ''), + value=value) + return info + + @adapter_config(context=IVideoParagraph, provides=IDocumentIndexInfo) def video_paragraph_index_info(paragraph): """Video paragraph index info"""