Updated CSS class
authorThierry Florac <thierry.florac@onf.fr>
Fri, 08 Dec 2017 10:47:40 +0100
changeset 314 18da24db44b6
parent 313 2e71fb238b1c
child 315 8654d1faa27d
Updated CSS class
src/pyams_content/component/extfile/zmi/__init__.py
--- a/src/pyams_content/component/extfile/zmi/__init__.py	Fri Dec 08 10:46:50 2017 +0100
+++ b/src/pyams_content/component/extfile/zmi/__init__.py	Fri Dec 08 10:47:40 2017 +0100
@@ -84,7 +84,7 @@
     """External file add menu"""
 
     label = _("Add external file")
-    label_css_class = 'fa fa-fw fa-file-o'
+    label_css_class = 'fa fa-fw fa-file-text-o'
 
     url = 'add-extfile.html'
     modal_target = True
@@ -96,7 +96,7 @@
     """External file add form"""
 
     legend = _("Add new external file")
-    icon_css_class = 'fa fa-fw fa-file-o'
+    icon_css_class = 'fa fa-fw fa-file-text-o'
 
     fields = field.Fields(IExtFile).select('title', 'description', 'author', 'language', 'data', 'filename')
     ajax_handler = 'add-extfile.json'
@@ -143,7 +143,7 @@
     """External file properties edit form"""
 
     legend = _("Update file properties")
-    icon_css_class = 'fa fa-fw fa-file-o'
+    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')
@@ -214,6 +214,13 @@
                                             'language', 'data', 'filename')
     ajax_handler = 'add-extimage.json'
 
+    def updateWidgets(self, prefix=None):
+        super(ExtImageAddForm, self).updateWidgets(prefix)
+        if 'title' in self.widgets:
+            self.widgets['title'].description = None
+        if 'description' in self.widgets:
+            self.widgets['description'].description = None
+
     def create(self, data):
         factory = EXTERNAL_FILES_FACTORIES.get('image')
         if factory is not None:
@@ -252,6 +259,13 @@
     fields = field.Fields(IExtImage).select('title', 'alt_title', 'description', 'author',
                                             'language', 'data', 'filename')
 
+    def updateWidgets(self, prefix=None):
+        super(ExtImagePropertiesEditForm, self).updateWidgets(prefix)
+        if 'title' in self.widgets:
+            self.widgets['title'].description = None
+        if 'description' in self.widgets:
+            self.widgets['description'].description = None
+
 
 @view_config(name='properties.json', context=IExtImage, request_type=IPyAMSLayer,
              permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)