merge default doc-dc
authorDamien Correia
Wed, 30 May 2018 16:36:17 +0200
branchdoc-dc
changeset 656 0abdc1492e03
parent 655 24187991ec4c (current diff)
parent 570 196121e4a6f4 (diff)
child 657 652a551b127e
merge default
--- 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'])
--- 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)
 
--- 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()
 
 
--- 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)
--- 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"""
--- 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))
--- 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,