|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from pyams_content.component.paragraph.interfaces import IBaseParagraph |
|
20 |
|
21 # import packages |
|
22 from pyams_file.schema import AudioField |
|
23 from pyams_i18n.schema import I18nHTMLField, I18nTextField |
|
24 from zope.schema import TextLine, Choice |
|
25 |
|
26 from pyams_content import _ |
|
27 |
|
28 |
|
29 # |
|
30 # Audio paragraph |
|
31 # |
|
32 |
|
33 AUDIO_PARAGRAPH_TYPE = 'Audio' |
|
34 AUDIO_PARAGRAPH_NAME = _("Audio") |
|
35 AUDIO_PARAGRAPH_RENDERERS = 'PyAMS.paragraph.audio.renderers' |
|
36 |
|
37 |
|
38 class IAudioParagraph(IBaseParagraph): |
|
39 """Audio paragraph""" |
|
40 |
|
41 body = I18nHTMLField(title=_("Body"), |
|
42 required=False) |
|
43 |
|
44 description = I18nTextField(title=_("Description"), |
|
45 description=_("File description displayed by front-office template"), |
|
46 required=False) |
|
47 |
|
48 author = TextLine(title=_("Author"), |
|
49 description=_("Name of document's author"), |
|
50 required=False) |
|
51 |
|
52 data = AudioField(title=_("Audio data"), |
|
53 description=_("Audio file content"), |
|
54 required=True) |
|
55 |
|
56 renderer = Choice(title=_("Audio template"), |
|
57 description=_("Presentation template used for this audio file"), |
|
58 vocabulary=AUDIO_PARAGRAPH_RENDERERS, |
|
59 default='default') |