Updated fields order
authorThierry Florac <thierry.florac@onf.fr>
Wed, 30 May 2018 16:56:00 +0200
changeset 571 b2e79295caec
parent 570 196121e4a6f4
child 572 0d59b87b68c4
Updated fields order
src/pyams_content/component/extfile/__init__.py
src/pyams_content/component/extfile/interfaces/__init__.py
src/pyams_content/component/extfile/zmi/__init__.py
--- a/src/pyams_content/component/extfile/__init__.py	Wed May 30 16:27:07 2018 +0200
+++ b/src/pyams_content/component/extfile/__init__.py	Wed May 30 16:56:00 2018 +0200
@@ -222,8 +222,6 @@
     icon_class = 'fa-file-image-o'
     icon_hint = _("Image")
 
-    title = FieldProperty(IExtMedia['title'])
-    alt_title = FieldProperty(IExtImage['alt_title'])
     _data = I18nFileProperty(IExtImage['data'])
 
     @property
@@ -254,7 +252,6 @@
     icon_class = 'fa-file-video-o'
     icon_hint = _("Video")
 
-    title = FieldProperty(IExtMedia['title'])
     data = I18nFileProperty(IExtVideo['data'])
 
 register_file_factory('video', ExtVideo, _("Video"))
@@ -274,7 +271,6 @@
     icon_class = 'fa-file-audio-o'
     icon_hint = _("Audio file")
 
-    title = FieldProperty(IExtMedia['title'])
     data = I18nFileProperty(IExtAudio['data'])
 
 register_file_factory('audio', ExtAudio, _("Audio file"))
--- a/src/pyams_content/component/extfile/interfaces/__init__.py	Wed May 30 16:27:07 2018 +0200
+++ b/src/pyams_content/component/extfile/interfaces/__init__.py	Wed May 30 16:56:00 2018 +0200
@@ -33,7 +33,7 @@
 class IBaseExtFile(IAssociationItem):
     """Base external file interface"""
 
-    title = I18nTextLineField(title=_("Title"),
+    title = I18nTextLineField(title=_("Alternate title"),
                               description=_("File title, as shown in front-office"),
                               required=False)
 
@@ -70,14 +70,6 @@
 class IExtImage(IExtMedia):
     """External image file interface"""
 
-    title = I18nTextLineField(title=_("Legend"),
-                              description=_("File legend, as shown in front-office"),
-                              required=False)
-
-    alt_title = I18nTextLineField(title=_("Accessibility title"),
-                                  description=_("Alternate title used to describe image content"),
-                                  required=False)
-
     data = I18nThumbnailImageField(title=_("Image data"),
                                    description=_("Image content"),
                                    required=True)
--- a/src/pyams_content/component/extfile/zmi/__init__.py	Wed May 30 16:27:07 2018 +0200
+++ b/src/pyams_content/component/extfile/zmi/__init__.py	Wed May 30 16:56:00 2018 +0200
@@ -101,7 +101,7 @@
     legend = _("Add new external file")
     icon_css_class = 'fa fa-fw fa-file-text-o'
 
-    fields = field.Fields(IExtFile).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtFile).select('data', 'filename', 'title', 'description', 'author', 'language')
     ajax_handler = 'add-extfile.json'
     edit_permission = MANAGE_CONTENT_PERMISSION
 
@@ -142,7 +142,7 @@
     icon_css_class = 'fa fa-fw fa-file-text-o'
     dialog_class = 'modal-large'
 
-    fields = field.Fields(IExtFile).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtFile).select('data', 'filename', 'title', 'description', 'author', 'language')
     ajax_handler = 'properties.json'
     edit_permission = MANAGE_CONTENT_PERMISSION
 
@@ -208,8 +208,7 @@
     legend = _("Add new image")
     icon_css_class = 'fa fa-fw fa-file-image-o'
 
-    fields = field.Fields(IExtImage).select('title', 'alt_title', 'description', 'author',
-                                            'language', 'data', 'filename')
+    fields = field.Fields(IExtImage).select('data', 'filename', 'title', 'description', 'author')
     ajax_handler = 'add-extimage.json'
 
     def updateWidgets(self, prefix=None):
@@ -245,8 +244,7 @@
     legend = _("Update image properties")
     icon_css_class = 'fa fa-fw fa-file-image-o'
 
-    fields = field.Fields(IExtImage).select('title', 'alt_title', 'description', 'author',
-                                            'language', 'data', 'filename')
+    fields = field.Fields(IExtImage).select('data', 'filename', 'title', 'description', 'author')
 
     def updateWidgets(self, prefix=None):
         super(ExtImagePropertiesEditForm, self).updateWidgets(prefix)
@@ -312,7 +310,7 @@
     legend = _("Add new video")
     icon_css_class = 'fa fa-fw fa-file-video-o'
 
-    fields = field.Fields(IExtVideo).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtVideo).select('data', 'filename', 'title', 'description', 'author', 'language')
     ajax_handler = 'add-extvideo.json'
 
     def create(self, data):
@@ -341,7 +339,7 @@
     legend = _("Update video properties")
     icon_css_class = 'fa fa-fw fa-file-video-o'
 
-    fields = field.Fields(IExtVideo).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtVideo).select('data', 'filename', 'title', 'description', 'author', 'language')
 
 
 @view_config(name='properties.json', context=IExtVideo, request_type=IPyAMSLayer,
@@ -400,7 +398,7 @@
     legend = _("Add new audio file")
     icon_css_class = 'fa fa-fw fa-file-audio-o'
 
-    fields = field.Fields(IExtAudio).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtAudio).select('data', 'filename', 'title', 'description', 'author', 'language')
     ajax_handler = 'add-extaudio.json'
 
     def create(self, data):
@@ -429,7 +427,7 @@
     legend = _("Update audio file properties")
     icon_css_class = 'fa fa-fw fa-file-audio-o'
 
-    fields = field.Fields(IExtAudio).select('title', 'description', 'author', 'language', 'data', 'filename')
+    fields = field.Fields(IExtAudio).select('data', 'filename', 'title', 'description', 'author', 'language')
 
 
 @view_config(name='properties.json', context=IExtAudio, request_type=IPyAMSLayer,