# HG changeset patch # User Damien Correia # Date 1527690977 -7200 # Node ID 0abdc1492e036ef04e958f7ecb70eff4561b9585 # Parent 24187991ec4c262f8c115c98ca2cd50d24d9a1da# Parent 196121e4a6f45a63b60faf657ef14ddd35a707c0 merge default diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/gallery/file.py --- a/src/pyams_content/component/gallery/file.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/gallery/file.py Wed May 30 16:36:17 2018 +0200 @@ -48,9 +48,9 @@ class GalleryFile(Persistent, Contained): """Gallery file info""" + _data = FileProperty(IGalleryFile['data']) title = FieldProperty(IGalleryFile['title']) alt_title = FieldProperty(IGalleryFile['alt_title']) - _data = FileProperty(IGalleryFile['data']) description = FieldProperty(IGalleryFile['description']) author = FieldProperty(IGalleryFile['author']) author_comments = FieldProperty(IGalleryFile['author_comments']) diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/gallery/interfaces/__init__.py --- a/src/pyams_content/component/gallery/interfaces/__init__.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/gallery/interfaces/__init__.py Wed May 30 16:36:17 2018 +0200 @@ -44,6 +44,10 @@ class IGalleryFile(IGalleryItem): """Gallery file marker interface""" + data = MediaField(title=_("Image or video data"), + description=_("Image or video content"), + required=True) + title = I18nTextLineField(title=_("Legend"), required=False) @@ -51,10 +55,6 @@ description=_("Alternate title used to describe media content"), required=False) - data = MediaField(title=_("Image or video data"), - description=_("Image or video content"), - required=True) - description = I18nTextField(title=_("Description"), required=False) diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/gallery/zmi/file.py --- a/src/pyams_content/component/gallery/zmi/file.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/file.py Wed May 30 16:36:17 2018 +0200 @@ -216,7 +216,7 @@ legend=_("Audio content"), css_class='inner', switch=True, - hide_if_empty=True)) + display_mode='auto')) super(GalleryFilePropertiesEditForm, self).updateGroups() diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/gallery/zmi/interfaces.py --- a/src/pyams_content/component/gallery/zmi/interfaces.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/gallery/zmi/interfaces.py Wed May 30 16:36:17 2018 +0200 @@ -33,6 +33,10 @@ class IGalleryMediasAddFields(Interface): """Gallery medias add fields""" + medias_data = FileField(title=_("Images or videos data"), + description=_("You can upload a single file or choose to upload a whole ZIP archive"), + required=True) + author = TextLine(title=_("Author"), description=_("Name of document's author"), required=False) @@ -40,7 +44,3 @@ author_comments = I18nTextField(title=_("Author comments"), description=_("Comments relatives to author's rights management"), required=False) - - medias_data = FileField(title=_("Images or videos data"), - description=_("You can upload a single file or choose to upload a whole ZIP archive"), - required=True) diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/paragraph/video.py --- a/src/pyams_content/component/paragraph/video.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/paragraph/video.py Wed May 30 16:36:17 2018 +0200 @@ -16,8 +16,6 @@ # import standard library # import interfaces -from pyams_content.component.extfile.interfaces import IExtFileContainerTarget -from pyams_content.component.links.interfaces import ILinkContainerTarget from pyams_content.component.paragraph.interfaces import IParagraphFactory from pyams_content.component.paragraph.interfaces.video import IVideoParagraph, VIDEO_PARAGRAPH_TYPE, \ VIDEO_PARAGRAPH_RENDERERS @@ -42,7 +40,7 @@ from pyams_content import _ -@implementer(IVideoParagraph, IExtFileContainerTarget, ILinkContainerTarget) +@implementer(IVideoParagraph) @factory_config(provided=IVideoParagraph) class VideoParagraph(BaseParagraph): """Video paragraph class""" diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/paragraph/zmi/video.py --- a/src/pyams_content/component/paragraph/zmi/video.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/paragraph/zmi/video.py Wed May 30 16:36:17 2018 +0200 @@ -84,7 +84,7 @@ legend=_("HTML content"), css_class='inner switcher padding-right-10 no-y-padding pull-left', switch=True, - hide_if_empty=True)) + display_mode='auto')) self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets, ('description', 'author', 'data', 'renderer'), bordered=False)) @@ -134,7 +134,7 @@ legend=_("HTML content"), css_class='inner switcher padding-right-10 no-y-padding pull-left', switch=True, - hide_if_empty=True)) + display_mode='auto')) self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets, ('description', 'author', 'data', 'renderer'), bordered=False)) diff -r 24187991ec4c -r 0abdc1492e03 src/pyams_content/component/video/zmi/paragraph.py --- a/src/pyams_content/component/video/zmi/paragraph.py Wed May 30 15:08:45 2018 +0200 +++ b/src/pyams_content/component/video/zmi/paragraph.py Wed May 30 16:36:17 2018 +0200 @@ -103,7 +103,7 @@ legend=_("HTML content"), css_class='inner switcher padding-right-10 no-y-padding pull-left', switch=True, - hide_if_empty=True)) + display_mode='auto')) self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets, ('description', 'author', 'renderer', 'provider_name'), bordered=False)) @@ -174,7 +174,7 @@ legend=_("Other settings"), css_class="inner switcher padding-right-10 no-y-padding", switch=True, - hide_if_empty=True)) + display_mode='auto')) super(ExternalVideoProviderSettingsAddForm, self).updateGroups() @@ -238,7 +238,7 @@ legend=_("HTML content"), css_class='inner switcher padding-right-10 no-y-padding pull-left', switch=True, - hide_if_empty=True)) + display_mode='auto')) self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets, ('description', 'author', 'renderer', 'provider_name'), bordered=False)) @@ -260,7 +260,7 @@ fieldset_class='margin-top-10 padding-y-5', css_class='inner switcher padding-right-10 no-y-padding pull-left', switch=True, - hide_if_empty=True)) + display_mode='never')) @view_config(name='properties.json', context=IExternalVideoParagraph, request_type=IPyAMSLayer,