Added audio paragraph
authorThierry Florac <thierry.florac@onf.fr>
Wed, 06 Jun 2018 11:06:51 +0200
changeset 585 9fa8e9776bda
parent 584 bfc376efd87c
child 586 28445044f6e3
Added audio paragraph
src/pyams_content/component/paragraph/audio.py
src/pyams_content/component/paragraph/interfaces/audio.py
src/pyams_content/component/paragraph/interfaces/video.py
src/pyams_content/component/paragraph/video.py
src/pyams_content/component/paragraph/zmi/audio.py
src/pyams_content/component/paragraph/zmi/video.py
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po
src/pyams_content/locales/pyams_content.pot
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/component/paragraph/audio.py	Wed Jun 06 11:06:51 2018 +0200
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_content.component.illustration.interfaces import IIllustrationTarget
+from pyams_content.component.paragraph.interfaces import IParagraphFactory
+from pyams_content.component.paragraph.interfaces.audio import IAudioParagraph, AUDIO_PARAGRAPH_TYPE, \
+    AUDIO_PARAGRAPH_RENDERERS, AUDIO_PARAGRAPH_NAME
+from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
+from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
+
+# import packages
+from pyams_content.component.paragraph import BaseParagraph, BaseParagraphContentChecker, BaseParagraphFactory
+from pyams_content.features.renderer import RenderersVocabulary
+from pyams_file.property import FileProperty
+from pyams_utils.adapter import adapter_config
+from pyams_utils.factory import factory_config
+from pyams_utils.registry import utility_config, get_utility
+from pyams_utils.traversing import get_parent
+from pyams_utils.vocabulary import vocabulary_config
+from zope.interface import implementer
+from zope.schema.fieldproperty import FieldProperty
+
+
+@implementer(IAudioParagraph, IIllustrationTarget)
+@factory_config(provided=IAudioParagraph)
+class AudioParagraph(BaseParagraph):
+    """Audio paragraph class"""
+
+    icon_class = 'fa-volume-up'
+    icon_hint = AUDIO_PARAGRAPH_NAME
+
+    body = FieldProperty(IAudioParagraph['body'])
+    description = FieldProperty(IAudioParagraph['description'])
+    author = FieldProperty(IAudioParagraph['author'])
+    data = FileProperty(IAudioParagraph['data'])
+    renderer = FieldProperty(IAudioParagraph['renderer'])
+
+
+@utility_config(name=AUDIO_PARAGRAPH_TYPE, provides=IParagraphFactory)
+class AudioParagraphFactory(BaseParagraphFactory):
+    """Audio paragraph factory"""
+
+    name = AUDIO_PARAGRAPH_NAME
+    content_type = AudioParagraph
+
+
+@adapter_config(context=IAudioParagraph, provides=IContentChecker)
+class AudioParagraphContentChecker(BaseParagraphContentChecker):
+    """Audio paragraph content checker"""
+
+    def inner_check(self, request):
+        output = []
+        translate = request.localizer.translate
+        manager = get_parent(self.context, II18nManager)
+        if manager is not None:
+            langs = manager.get_languages()
+        else:
+            negotiator = get_utility(INegotiator)
+            langs = (negotiator.server_language, )
+        i18n = II18n(self.context)
+        for lang in langs:
+            value = i18n.get_attribute('title', lang, request)
+            if not value:
+                field_title = translate(IAudioParagraph['title'].title)
+                if len(langs) == 1:
+                    output.append(translate(MISSING_VALUE).format(field=field_title))
+                else:
+                    output.append(translate(MISSING_LANG_VALUE).format(field=field_title, lang=lang))
+        for attr in ('author', 'data'):
+            value = getattr(self.context, attr)
+            if not value:
+                output.append(translate(MISSING_VALUE).format(field=translate(IAudioParagraph[attr].title)))
+        return output
+
+
+@vocabulary_config(name=AUDIO_PARAGRAPH_RENDERERS)
+class AudioParagraphRendererVocabulary(RenderersVocabulary):
+    """Audio paragraph renderers vocabulary"""
+
+    content_interface = IAudioParagraph
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/component/paragraph/interfaces/audio.py	Wed Jun 06 11:06:51 2018 +0200
@@ -0,0 +1,59 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_content.component.paragraph.interfaces import IBaseParagraph
+
+# import packages
+from pyams_file.schema import AudioField
+from pyams_i18n.schema import I18nHTMLField, I18nTextField
+from zope.schema import TextLine, Choice
+
+from pyams_content import _
+
+
+#
+# Audio paragraph
+#
+
+AUDIO_PARAGRAPH_TYPE = 'Audio'
+AUDIO_PARAGRAPH_NAME = _("Audio")
+AUDIO_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.audio.renderers'
+
+
+class IAudioParagraph(IBaseParagraph):
+    """Audio paragraph"""
+
+    body = I18nHTMLField(title=_("Body"),
+                         required=False)
+
+    description = I18nTextField(title=_("Description"),
+                                description=_("File description displayed by front-office template"),
+                                required=False)
+
+    author = TextLine(title=_("Author"),
+                      description=_("Name of document's author"),
+                      required=False)
+
+    data = AudioField(title=_("Audio data"),
+                      description=_("Audio file content"),
+                      required=True)
+
+    renderer = Choice(title=_("Audio template"),
+                      description=_("Presentation template used for this audio file"),
+                      vocabulary=AUDIO_PARAGRAPH_RENDERERS,
+                      default='default')
--- a/src/pyams_content/component/paragraph/interfaces/video.py	Wed Jun 06 10:31:48 2018 +0200
+++ b/src/pyams_content/component/paragraph/interfaces/video.py	Wed Jun 06 11:06:51 2018 +0200
@@ -31,6 +31,7 @@
 #
 
 VIDEO_PARAGRAPH_TYPE = 'Video'
+VIDEO_PARAGRAPH_NAME = _("Video")
 VIDEO_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.video.renderers'
 
 
--- a/src/pyams_content/component/paragraph/video.py	Wed Jun 06 10:31:48 2018 +0200
+++ b/src/pyams_content/component/paragraph/video.py	Wed Jun 06 11:06:51 2018 +0200
@@ -18,7 +18,7 @@
 # import interfaces
 from pyams_content.component.paragraph.interfaces import IParagraphFactory
 from pyams_content.component.paragraph.interfaces.video import IVideoParagraph, VIDEO_PARAGRAPH_TYPE, \
-    VIDEO_PARAGRAPH_RENDERERS
+    VIDEO_PARAGRAPH_RENDERERS, VIDEO_PARAGRAPH_NAME
 from pyams_content.features.checker.interfaces import IContentChecker, MISSING_VALUE, MISSING_LANG_VALUE
 from pyams_i18n.interfaces import II18nManager, INegotiator, II18n
 
@@ -34,8 +34,6 @@
 from zope.interface import implementer
 from zope.schema.fieldproperty import FieldProperty
 
-from pyams_content import _
-
 
 @implementer(IVideoParagraph)
 @factory_config(provided=IVideoParagraph)
@@ -43,7 +41,7 @@
     """Video paragraph class"""
 
     icon_class = 'fa-film'
-    icon_hint = _("Video")
+    icon_hint = VIDEO_PARAGRAPH_NAME
 
     body = FieldProperty(IVideoParagraph['body'])
     description = FieldProperty(IVideoParagraph['description'])
@@ -56,7 +54,7 @@
 class VideoParagraphFactory(BaseParagraphFactory):
     """Video paragraph factory"""
 
-    name = _("Video")
+    name = VIDEO_PARAGRAPH_NAME
     content_type = VideoParagraph
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/component/paragraph/zmi/audio.py	Wed Jun 06 11:06:51 2018 +0200
@@ -0,0 +1,182 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+
+# import interfaces
+from pyams_content.component.association.zmi.interfaces import IAssociationsParentForm
+from pyams_content.component.paragraph.interfaces import IParagraphContainerTarget, IParagraphContainer
+from pyams_content.component.paragraph.interfaces.audio import IAudioParagraph, AUDIO_PARAGRAPH_TYPE
+from pyams_content.component.paragraph.zmi.interfaces import IParagraphInnerEditor, IParagraphContainerView
+from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION
+from pyams_form.interfaces.form import IInnerForm
+from pyams_skin.interfaces.viewlet import IToolbarAddingMenu
+from pyams_skin.layer import IPyAMSLayer
+from pyams_zmi.interfaces import IPropertiesEditForm
+from transaction.interfaces import ITransactionManager
+from z3c.form.interfaces import INPUT_MODE
+
+# import packages
+from pyams_content.component.paragraph.audio import AudioParagraph
+from pyams_content.component.paragraph.zmi import BaseParagraphAJAXAddForm, BaseParagraphAJAXEditForm, \
+    BaseParagraphAddMenu, BaseParagraphPropertiesEditForm, IParagraphEditFormButtons
+from pyams_content.features.renderer.zmi.widget import RendererFieldWidget
+from pyams_form.group import NamedWidgetsGroup
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_skin.event import get_json_form_refresh_event, get_json_widget_refresh_event
+from pyams_utils.adapter import adapter_config
+from pyams_viewlet.viewlet import viewlet_config
+from pyams_zmi.form import AdminDialogAddForm
+from pyramid.view import view_config
+from z3c.form import field, button
+from zope.interface import implementer
+
+from pyams_content import _
+
+
+@viewlet_config(name='add-audio-paragraph.menu', context=IParagraphContainerTarget, view=IParagraphContainerView,
+                layer=IPyAMSLayer, manager=IToolbarAddingMenu, weight=80)
+class AudioParagraphAddMenu(BaseParagraphAddMenu):
+    """Audio paragraph add menu"""
+
+    label = _("Audio paragraph...")
+    label_css_class = 'fa fa-fw fa-volume-up'
+    url = 'add-audio-paragraph.html'
+    paragraph_type = AUDIO_PARAGRAPH_TYPE
+
+
+@pagelet_config(name='add-audio-paragraph.html', context=IParagraphContainerTarget, layer=IPyAMSLayer,
+                permission=MANAGE_CONTENT_PERMISSION)
+class AudioParagraphAddForm(AdminDialogAddForm):
+    """Audio paragraph add form"""
+
+    legend = _("Add new audio paragraph")
+    dialog_class = 'modal-large'
+    icon_css_class = 'fa fa-fw fa-volume-up'
+
+    fields = field.Fields(IAudioParagraph).omit('__parent__', '__name__', 'visible')
+    ajax_handler = 'add-audio-paragraph.json'
+    edit_permission = MANAGE_CONTENT_PERMISSION
+
+    def updateWidgets(self, prefix=None):
+        super(AudioParagraphAddForm, self).updateWidgets(prefix)
+        if 'description' in self.widgets:
+            self.widgets['description'].widget_css_class = 'textarea'
+        if 'body' in self.widgets:
+            self.widgets['body'].label = ''
+            
+    def updateGroups(self):
+        self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
+                                         bordered=False,
+                                         legend=_("HTML content"),
+                                         css_class='inner switcher padding-right-10 no-y-padding pull-left',
+                                         switch=True,
+                                         display_mode='auto'))
+        self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
+                                         ('description', 'author', 'data', 'renderer'),
+                                         bordered=False))
+        super(AudioParagraphAddForm, self).updateGroups()
+
+    def create(self, data):
+        return AudioParagraph()
+
+    def add(self, object):
+        IParagraphContainer(self.context).append(object)
+
+
+@view_config(name='add-audio-paragraph.json', context=IParagraphContainerTarget, request_type=IPyAMSLayer,
+             permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
+class AudioParagraphAJAXAddForm(BaseParagraphAJAXAddForm, AudioParagraphAddForm):
+    """Audio paragraph add form, JSON renderer"""
+
+
+@pagelet_config(name='properties.html', context=IAudioParagraph, layer=IPyAMSLayer,
+                permission=MANAGE_CONTENT_PERMISSION)
+class AudioParagraphPropertiesEditForm(BaseParagraphPropertiesEditForm):
+    """Audio paragraph properties edit form"""
+
+    prefix = 'audio_properties.'
+
+    legend = _("Edit audio properties")
+    dialog_class = 'modal-large'
+    icon_css_class = 'fa fa-fw fa-volume-up'
+
+    fields = field.Fields(IAudioParagraph).omit('__parent__', '__name__', 'visible')
+    fields['renderer'].widgetFactory = RendererFieldWidget
+
+    ajax_handler = 'properties.json'
+    edit_permission = MANAGE_CONTENT_PERMISSION
+
+    def updateWidgets(self, prefix=None):
+        super(AudioParagraphPropertiesEditForm, self).updateWidgets(prefix)
+        if 'description' in self.widgets:
+            self.widgets['description'].widget_css_class = 'textarea'
+        if 'body' in self.widgets:
+            self.widgets['body'].label = ''
+            
+    def updateGroups(self):
+        self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
+                                         bordered=False,
+                                         fieldset_class='margin-top-10 padding-y-5',
+                                         legend=_("HTML content"),
+                                         css_class='inner switcher padding-right-10 no-y-padding pull-left',
+                                         switch=True,
+                                         display_mode='auto'))
+        self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
+                                         ('description', 'author', 'data', 'renderer'),
+                                         bordered=False))
+        super(AudioParagraphPropertiesEditForm, self).updateGroups()
+
+
+@view_config(name='properties.json', context=IAudioParagraph, request_type=IPyAMSLayer,
+             permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
+class AudioParagraphPropertiesAJAXEditForm(BaseParagraphAJAXEditForm, AudioParagraphPropertiesEditForm):
+    """Audio paragraph properties edit form, JSON renderer"""
+
+
+@adapter_config(context=(IAudioParagraph, IPyAMSLayer), provides=IParagraphInnerEditor)
+@implementer(IInnerForm, IPropertiesEditForm, IAssociationsParentForm)
+class AudioParagraphPropertiesInnerEditForm(AudioParagraphPropertiesEditForm):
+    """Audio paragraph properties inner edit form"""
+
+    legend = None
+    ajax_handler = 'inner-properties.json'
+
+    @property
+    def buttons(self):
+        if self.mode == INPUT_MODE:
+            return button.Buttons(IParagraphEditFormButtons)
+        else:
+            return button.Buttons()
+
+
+@view_config(name='inner-properties.json', context=IAudioParagraph, request_type=IPyAMSLayer,
+             permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
+class AudioParagraphPropertiesInnerAJAXEditForm(BaseParagraphAJAXEditForm, AudioParagraphPropertiesInnerEditForm):
+    """Audio paragraph properties inner deit form, JSON renderer"""
+
+    def get_ajax_output(self, changes):
+        output = super(AudioParagraphPropertiesInnerAJAXEditForm, self).get_ajax_output(changes)
+        updated = changes.get(IAudioParagraph, ())
+        if 'data' in updated:
+            # we have to commit transaction to be able to handle blobs...
+            ITransactionManager(self.context).get().commit()
+            output.setdefault('events', []).append(
+                get_json_form_refresh_event(self.context, self.request, AudioParagraphPropertiesInnerEditForm))
+        elif 'renderer' in updated:
+            output.setdefault('events', []).append(
+                get_json_widget_refresh_event(self.context, self.request,
+                                              AudioParagraphPropertiesInnerEditForm, 'renderer'))
+        return output
--- a/src/pyams_content/component/paragraph/zmi/video.py	Wed Jun 06 10:31:48 2018 +0200
+++ b/src/pyams_content/component/paragraph/zmi/video.py	Wed Jun 06 11:06:51 2018 +0200
@@ -29,7 +29,6 @@
 from z3c.form.interfaces import INPUT_MODE
 
 # import packages
-from pyams_content.component.association.zmi import AssociationsTable
 from pyams_content.component.paragraph.video import VideoParagraph
 from pyams_content.component.paragraph.zmi import BaseParagraphAJAXAddForm, BaseParagraphAJAXEditForm, \
     BaseParagraphAddMenu, BaseParagraphPropertiesEditForm, IParagraphEditFormButtons
@@ -146,18 +145,6 @@
 class VideoParagraphPropertiesAJAXEditForm(BaseParagraphAJAXEditForm, VideoParagraphPropertiesEditForm):
     """Video paragraph properties edit form, JSON renderer"""
 
-    def get_ajax_output(self, changes):
-        output = super(VideoParagraphPropertiesAJAXEditForm, self).get_ajax_output(changes)
-        if 'body' in changes.get(IVideoParagraph, ()):
-            associations_table = AssociationsTable(self.context, self.request)
-            associations_table.update()
-            output.setdefault('events', []).append({
-                'event': 'PyAMS_content.changed_item',
-                'options': {'handler': 'PyAMS_content.associations.refreshAssociations',
-                            'object_name': associations_table.id,
-                            'table': associations_table.render()}})
-        return output
-
 
 @adapter_config(context=(IVideoParagraph, IPyAMSLayer), provides=IParagraphInnerEditor)
 @implementer(IInnerForm, IPropertiesEditForm, IAssociationsParentForm)
@@ -183,15 +170,6 @@
     def get_ajax_output(self, changes):
         output = super(VideoParagraphPropertiesInnerAJAXEditForm, self).get_ajax_output(changes)
         updated = changes.get(IVideoParagraph, ())
-        if 'body' in updated:
-            associations_table = AssociationsTable(self.context, self.request)
-            associations_table.update()
-            output.setdefault('events', []).append({
-                'event': 'PyAMS_content.changed_item',
-                'options': {'handler': 'PyAMS_content.associations.refreshAssociations',
-                            'object_name': associations_table.id,
-                            'table': associations_table.render()}
-            })
         if 'data' in updated:
             # we have to commit transaction to be able to handle blobs...
             ITransactionManager(self.context).get().commit()
Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed
--- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Wed Jun 06 10:31:48 2018 +0200
+++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Wed Jun 06 11:06:51 2018 +0200
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-06-06 10:19+0200\n"
+"POT-Creation-Date: 2018-06-06 11:02+0200\n"
 "PO-Revision-Date: 2015-09-10 10:42+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -141,7 +141,8 @@
 #: src/pyams_content/component/gallery/interfaces/__init__.py:61
 #: src/pyams_content/component/extfile/interfaces/__init__.py:44
 #: src/pyams_content/component/illustration/interfaces/__init__.py:56
-#: src/pyams_content/component/paragraph/interfaces/video.py:47
+#: src/pyams_content/component/paragraph/interfaces/video.py:48
+#: src/pyams_content/component/paragraph/interfaces/audio.py:48
 #: src/pyams_content/component/paragraph/interfaces/verbatim.py:43
 #: src/pyams_content/component/video/interfaces/__init__.py:52
 msgid "Author"
@@ -150,7 +151,8 @@
 #: src/pyams_content/component/gallery/zmi/interfaces.py:41
 #: src/pyams_content/component/gallery/interfaces/__init__.py:62
 #: src/pyams_content/component/extfile/interfaces/__init__.py:45
-#: src/pyams_content/component/paragraph/interfaces/video.py:48
+#: src/pyams_content/component/paragraph/interfaces/video.py:49
+#: src/pyams_content/component/paragraph/interfaces/audio.py:49
 #: src/pyams_content/component/video/interfaces/__init__.py:53
 msgid "Name of document's author"
 msgstr "Sous la forme \"Prénom Nom / Organisme\""
@@ -214,7 +216,8 @@
 #: src/pyams_content/component/gallery/interfaces/__init__.py:98
 #: src/pyams_content/component/extfile/interfaces/__init__.py:40
 #: src/pyams_content/component/illustration/interfaces/__init__.py:52
-#: src/pyams_content/component/paragraph/interfaces/video.py:43
+#: src/pyams_content/component/paragraph/interfaces/video.py:44
+#: src/pyams_content/component/paragraph/interfaces/audio.py:44
 #: src/pyams_content/component/links/interfaces/__init__.py:37
 #: src/pyams_content/component/video/interfaces/__init__.py:48
 #: src/pyams_content/shared/common/interfaces/__init__.py:145
@@ -238,6 +241,7 @@
 
 #: src/pyams_content/component/gallery/interfaces/__init__.py:73
 #: src/pyams_content/component/extfile/interfaces/__init__.py:89
+#: src/pyams_content/component/paragraph/interfaces/audio.py:52
 msgid "Audio data"
 msgstr "Fichier"
 
@@ -318,8 +322,7 @@
 
 #: src/pyams_content/component/extfile/__init__.py:253
 #: src/pyams_content/component/extfile/__init__.py:257
-#: src/pyams_content/component/paragraph/video.py:49
-#: src/pyams_content/component/paragraph/video.py:62
+#: src/pyams_content/component/paragraph/interfaces/video.py:34
 msgid "Video"
 msgstr "Vidéo"
 
@@ -382,15 +385,15 @@
 
 #: src/pyams_content/component/extfile/zmi/__init__.py:386
 msgid "Add audio file"
-msgstr "Audio téléchargeable"
+msgstr "Bande son téléchargeable"
 
 #: src/pyams_content/component/extfile/zmi/__init__.py:398
 msgid "Add new audio file"
-msgstr "Ajout d'un fichier audio téléchargeable"
+msgstr "Ajout d'une bande son téléchargeable"
 
 #: src/pyams_content/component/extfile/zmi/__init__.py:427
 msgid "Update audio file properties"
-msgstr "Propriétés du fichier audio téléchargeable"
+msgstr "Propriétés de la bande son téléchargeable"
 
 #: src/pyams_content/component/extfile/zmi/__init__.py:50
 msgid "External file type"
@@ -408,7 +411,8 @@
 msgstr "Titre présenté aux internautes"
 
 #: src/pyams_content/component/extfile/interfaces/__init__.py:41
-#: src/pyams_content/component/paragraph/interfaces/video.py:44
+#: src/pyams_content/component/paragraph/interfaces/video.py:45
+#: src/pyams_content/component/paragraph/interfaces/audio.py:45
 #: src/pyams_content/component/video/interfaces/__init__.py:49
 msgid "File description displayed by front-office template"
 msgstr "Description du fichier, présentée aux internautes"
@@ -453,7 +457,7 @@
 "Cliquez sur le bouton 'Parcourir...' pour sélectionner un nouveau contenu..."
 
 #: src/pyams_content/component/extfile/interfaces/__init__.py:81
-#: src/pyams_content/component/paragraph/interfaces/video.py:51
+#: src/pyams_content/component/paragraph/interfaces/video.py:52
 msgid "Video data"
 msgstr "Fichier"
 
@@ -463,6 +467,7 @@
 "Cliquez sur le bouton 'Parcourir...' pour sélectionner un nouveau contenu"
 
 #: src/pyams_content/component/extfile/interfaces/__init__.py:90
+#: src/pyams_content/component/paragraph/interfaces/audio.py:53
 msgid "Audio file content"
 msgstr ""
 "Cliquez sur le bouton 'Parcourir...' pour sélectionner un nouveau contenu"
@@ -732,21 +737,23 @@
 msgid "Paragraph was correctly added."
 msgstr "Le bloc a été ajouté."
 
-#: src/pyams_content/component/paragraph/zmi/video.py:55
+#: src/pyams_content/component/paragraph/zmi/video.py:54
 msgid "Video paragraph..."
 msgstr "Vidéo"
 
-#: src/pyams_content/component/paragraph/zmi/video.py:66
+#: src/pyams_content/component/paragraph/zmi/video.py:65
 msgid "Add new video paragraph"
 msgstr "Ajout d'une vidéo"
 
-#: src/pyams_content/component/paragraph/zmi/video.py:113
+#: src/pyams_content/component/paragraph/zmi/video.py:112
 #: src/pyams_content/component/video/zmi/paragraph.py:209
 msgid "Edit video properties"
 msgstr "Propriétés de la vidéo"
 
-#: src/pyams_content/component/paragraph/zmi/video.py:84
-#: src/pyams_content/component/paragraph/zmi/video.py:134
+#: src/pyams_content/component/paragraph/zmi/video.py:83
+#: src/pyams_content/component/paragraph/zmi/video.py:133
+#: src/pyams_content/component/paragraph/zmi/audio.py:83
+#: src/pyams_content/component/paragraph/zmi/audio.py:133
 #: src/pyams_content/component/video/zmi/paragraph.py:103
 #: src/pyams_content/component/video/zmi/paragraph.py:238
 msgid "HTML content"
@@ -851,6 +858,18 @@
 msgid "Default header: {0}"
 msgstr "En-tête par défaut : {0}"
 
+#: src/pyams_content/component/paragraph/zmi/audio.py:54
+msgid "Audio paragraph..."
+msgstr "Bande son"
+
+#: src/pyams_content/component/paragraph/zmi/audio.py:65
+msgid "Add new audio paragraph"
+msgstr "Ajout d'une bande son"
+
+#: src/pyams_content/component/paragraph/zmi/audio.py:112
+msgid "Edit audio properties"
+msgstr "Propriétés de la bande son"
+
 #: src/pyams_content/component/paragraph/zmi/keynumber.py:76
 msgid "Key numbers..."
 msgstr "Chiffres-clés"
@@ -1045,23 +1064,24 @@
 msgid "List of paragraphs automatically added to a new content"
 msgstr "Liste des types de blocs ajoutés automatiquement aux nouveaux contenus"
 
-#: src/pyams_content/component/paragraph/interfaces/video.py:40
+#: src/pyams_content/component/paragraph/interfaces/video.py:41
+#: src/pyams_content/component/paragraph/interfaces/audio.py:41
 #: src/pyams_content/component/paragraph/interfaces/html.py:61
 #: src/pyams_content/component/video/interfaces/__init__.py:74
 msgid "Body"
 msgstr "Contenu HTML"
 
-#: src/pyams_content/component/paragraph/interfaces/video.py:52
+#: src/pyams_content/component/paragraph/interfaces/video.py:53
 msgid "Video file content"
 msgstr ""
 "Cliquez sur le bouton 'Parcourir...' pour sélectionner un nouveau contenu"
 
-#: src/pyams_content/component/paragraph/interfaces/video.py:55
+#: src/pyams_content/component/paragraph/interfaces/video.py:56
 #: src/pyams_content/component/video/interfaces/__init__.py:77
 msgid "Video template"
 msgstr "Mode de rendu"
 
-#: src/pyams_content/component/paragraph/interfaces/video.py:56
+#: src/pyams_content/component/paragraph/interfaces/video.py:57
 #: src/pyams_content/component/video/interfaces/__init__.py:78
 msgid "Presentation template used for this video"
 msgstr "Mode de rendu utilisé par cette vidéo"
@@ -1105,6 +1125,18 @@
 msgid "Presentation template used for pictograms"
 msgstr "Modèle de présentation utilisé par ce bloc de contenu"
 
+#: src/pyams_content/component/paragraph/interfaces/audio.py:34
+msgid "Audio"
+msgstr "Bande son"
+
+#: src/pyams_content/component/paragraph/interfaces/audio.py:56
+msgid "Audio template"
+msgstr "Mode de rendu"
+
+#: src/pyams_content/component/paragraph/interfaces/audio.py:57
+msgid "Presentation template used for this audio file"
+msgstr "Mode de rendu utilisé pour cette bande son"
+
 #: src/pyams_content/component/paragraph/interfaces/keynumber.py:41
 msgid "Is this key number visible in front-office?"
 msgstr "Si 'non', ce chiffre-clé ne sera pas présenté aux internautes"
@@ -3846,7 +3878,9 @@
 
 #: src/pyams_content/shared/site/interfaces/__init__.py:59
 msgid "Heading displayed according to presentation template"
-msgstr "Ce chapô pourra être affiché ou non en fonction du modèle de présentation retenu"
+msgstr ""
+"Ce chapô pourra être affiché ou non en fonction du modèle de présentation "
+"retenu"
 
 #: src/pyams_content/shared/site/interfaces/__init__.py:62
 msgid "Navigation title"
--- a/src/pyams_content/locales/pyams_content.pot	Wed Jun 06 10:31:48 2018 +0200
+++ b/src/pyams_content/locales/pyams_content.pot	Wed Jun 06 11:06:51 2018 +0200
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-06-06 10:19+0200\n"
+"POT-Creation-Date: 2018-06-06 11:02+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"
@@ -140,7 +140,8 @@
 #: ./src/pyams_content/component/gallery/interfaces/__init__.py:61
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:44
 #: ./src/pyams_content/component/illustration/interfaces/__init__.py:56
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:47
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:48
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:48
 #: ./src/pyams_content/component/paragraph/interfaces/verbatim.py:43
 #: ./src/pyams_content/component/video/interfaces/__init__.py:52
 msgid "Author"
@@ -149,7 +150,8 @@
 #: ./src/pyams_content/component/gallery/zmi/interfaces.py:41
 #: ./src/pyams_content/component/gallery/interfaces/__init__.py:62
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:45
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:48
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:49
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:49
 #: ./src/pyams_content/component/video/interfaces/__init__.py:53
 msgid "Name of document's author"
 msgstr ""
@@ -206,7 +208,8 @@
 #: ./src/pyams_content/component/gallery/interfaces/__init__.py:98
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:40
 #: ./src/pyams_content/component/illustration/interfaces/__init__.py:52
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:43
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:44
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:44
 #: ./src/pyams_content/component/links/interfaces/__init__.py:37
 #: ./src/pyams_content/component/video/interfaces/__init__.py:48
 #: ./src/pyams_content/shared/common/interfaces/__init__.py:145
@@ -228,6 +231,7 @@
 
 #: ./src/pyams_content/component/gallery/interfaces/__init__.py:73
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:89
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:52
 msgid "Audio data"
 msgstr ""
 
@@ -305,8 +309,7 @@
 
 #: ./src/pyams_content/component/extfile/__init__.py:253
 #: ./src/pyams_content/component/extfile/__init__.py:257
-#: ./src/pyams_content/component/paragraph/video.py:49
-#: ./src/pyams_content/component/paragraph/video.py:62
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:34
 msgid "Video"
 msgstr ""
 
@@ -395,7 +398,8 @@
 msgstr ""
 
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:41
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:44
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:45
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:45
 #: ./src/pyams_content/component/video/interfaces/__init__.py:49
 msgid "File description displayed by front-office template"
 msgstr ""
@@ -435,7 +439,7 @@
 msgstr ""
 
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:81
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:51
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:52
 msgid "Video data"
 msgstr ""
 
@@ -444,6 +448,7 @@
 msgstr ""
 
 #: ./src/pyams_content/component/extfile/interfaces/__init__.py:90
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:53
 msgid "Audio file content"
 msgstr ""
 
@@ -695,21 +700,23 @@
 msgid "Paragraph was correctly added."
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/zmi/video.py:55
+#: ./src/pyams_content/component/paragraph/zmi/video.py:54
 msgid "Video paragraph..."
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/zmi/video.py:66
+#: ./src/pyams_content/component/paragraph/zmi/video.py:65
 msgid "Add new video paragraph"
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/zmi/video.py:113
+#: ./src/pyams_content/component/paragraph/zmi/video.py:112
 #: ./src/pyams_content/component/video/zmi/paragraph.py:209
 msgid "Edit video properties"
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/zmi/video.py:84
-#: ./src/pyams_content/component/paragraph/zmi/video.py:134
+#: ./src/pyams_content/component/paragraph/zmi/video.py:83
+#: ./src/pyams_content/component/paragraph/zmi/video.py:133
+#: ./src/pyams_content/component/paragraph/zmi/audio.py:83
+#: ./src/pyams_content/component/paragraph/zmi/audio.py:133
 #: ./src/pyams_content/component/video/zmi/paragraph.py:103
 #: ./src/pyams_content/component/video/zmi/paragraph.py:238
 msgid "HTML content"
@@ -812,6 +819,18 @@
 msgid "Default header: {0}"
 msgstr ""
 
+#: ./src/pyams_content/component/paragraph/zmi/audio.py:54
+msgid "Audio paragraph..."
+msgstr ""
+
+#: ./src/pyams_content/component/paragraph/zmi/audio.py:65
+msgid "Add new audio paragraph"
+msgstr ""
+
+#: ./src/pyams_content/component/paragraph/zmi/audio.py:112
+msgid "Edit audio properties"
+msgstr ""
+
 #: ./src/pyams_content/component/paragraph/zmi/keynumber.py:76
 msgid "Key numbers..."
 msgstr ""
@@ -1002,22 +1021,23 @@
 msgid "List of paragraphs automatically added to a new content"
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:40
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:41
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:41
 #: ./src/pyams_content/component/paragraph/interfaces/html.py:61
 #: ./src/pyams_content/component/video/interfaces/__init__.py:74
 msgid "Body"
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:52
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:53
 msgid "Video file content"
 msgstr ""
 
-#: ./src/pyams_content/component/paragraph/interfaces/video.py:55
-#: ./src/pyams_content/component/video/interfaces/__init__.py:77
-msgid "Video template"
-msgstr ""
-
 #: ./src/pyams_content/component/paragraph/interfaces/video.py:56
+#: ./src/pyams_content/component/video/interfaces/__init__.py:77
+msgid "Video template"
+msgstr ""
+
+#: ./src/pyams_content/component/paragraph/interfaces/video.py:57
 #: ./src/pyams_content/component/video/interfaces/__init__.py:78
 msgid "Presentation template used for this video"
 msgstr ""
@@ -1059,6 +1079,18 @@
 msgid "Presentation template used for pictograms"
 msgstr ""
 
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:34
+msgid "Audio"
+msgstr ""
+
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:56
+msgid "Audio template"
+msgstr ""
+
+#: ./src/pyams_content/component/paragraph/interfaces/audio.py:57
+msgid "Presentation template used for this audio file"
+msgstr ""
+
 #: ./src/pyams_content/component/paragraph/interfaces/keynumber.py:41
 msgid "Is this key number visible in front-office?"
 msgstr ""