20 from pyams_content.features.renderer.interfaces import IRenderedContent |
20 from pyams_content.features.renderer.interfaces import IRenderedContent |
21 from pyams_i18n.schema import I18nTextLineField, I18nTextField, I18nThumbnailMediaField |
21 from pyams_i18n.schema import I18nTextLineField, I18nTextField, I18nThumbnailMediaField |
22 from zope.annotation.interfaces import IAttributeAnnotatable |
22 from zope.annotation.interfaces import IAttributeAnnotatable |
23 |
23 |
24 # import packages |
24 # import packages |
|
25 from zope.interface import Interface |
25 from zope.schema import Choice, TextLine |
26 from zope.schema import Choice, TextLine |
26 |
27 |
27 from pyams_content import _ |
28 from pyams_content import _ |
28 |
29 |
29 |
30 |
30 # |
31 # |
31 # Illustration |
32 # Illustration |
32 # |
33 # |
33 |
34 |
|
35 BASIC_ILLUSTRATION_KEY = 'pyams_content.illustration.base' |
|
36 |
34 ILLUSTRATION_KEY = 'pyams_content.illustration' |
37 ILLUSTRATION_KEY = 'pyams_content.illustration' |
35 ILLUSTRATION_RENDERERS = 'PyAMS.illustration.renderers' |
38 ILLUSTRATION_RENDERERS = 'PyAMS.illustration.renderers' |
36 |
39 |
37 |
40 |
38 class IIllustration(IRenderedContent): |
41 class IBasicIllustration(Interface): |
39 """Illustration paragraph""" |
42 """Basic illustration interface""" |
40 |
43 |
41 data = I18nThumbnailMediaField(title=_("Image or video data"), |
44 data = I18nThumbnailMediaField(title=_("Image or video data"), |
42 description=_("Image or video content"), |
45 description=_("Image or video content"), |
43 required=False) |
46 required=False) |
44 |
47 |
46 required=False) |
49 required=False) |
47 |
50 |
48 alt_title = I18nTextLineField(title=_("Accessibility title"), |
51 alt_title = I18nTextLineField(title=_("Accessibility title"), |
49 description=_("Alternate title used to describe image content"), |
52 description=_("Alternate title used to describe image content"), |
50 required=False) |
53 required=False) |
|
54 |
|
55 |
|
56 class IIllustration(IBasicIllustration, IRenderedContent): |
|
57 """Illustration paragraph""" |
51 |
58 |
52 description = I18nTextField(title=_("Description"), |
59 description = I18nTextField(title=_("Description"), |
53 description=_(""), |
60 description=_(""), |
54 required=False) |
61 required=False) |
55 |
62 |
61 description=_("Presentation template used for illustration"), |
68 description=_("Presentation template used for illustration"), |
62 vocabulary=ILLUSTRATION_RENDERERS, |
69 vocabulary=ILLUSTRATION_RENDERERS, |
63 default='default') |
70 default='default') |
64 |
71 |
65 |
72 |
66 class IIllustrationTarget(IAttributeAnnotatable): |
73 class IBasicIllustrationTarget(IAttributeAnnotatable): |
67 """Illustration target marker interface""" |
74 """Basic illustration target marker interface""" |
|
75 |
|
76 |
|
77 class IIllustrationTarget(IBasicIllustrationTarget): |
|
78 """Illustration target interface""" |
68 |
79 |
69 |
80 |
70 ILLUSTRATION_PARAGRAPH_TYPE = 'Illustration' |
81 ILLUSTRATION_PARAGRAPH_TYPE = 'Illustration' |
71 ILLUSTRATION_PARAGRAPH_NAME = _("Illustration") |
82 ILLUSTRATION_PARAGRAPH_NAME = _("Illustration") |
72 |
83 |