src/pyams_content/shared/common/zmi/types.py
changeset 951 9395a088cd46
parent 925 9c8e01516f97
child 956 a8723fffbaf6
--- a/src/pyams_content/shared/common/zmi/types.py	Mon Sep 17 17:37:46 2018 +0200
+++ b/src/pyams_content/shared/common/zmi/types.py	Tue Sep 18 15:40:16 2018 +0200
@@ -580,6 +580,15 @@
 class TypedSharedContentProperteisEditForm(SharedContentPropertiesEditForm):
     """Typed shared content properties edit form"""
 
-    fields = field.Fields(IWfTypedSharedContent).select('title', 'short_name', 'content_url',
-                                                        'data_type', 'description', 'notepad')
-    fields['title'].widgetFactory = I18nSEOTextLineFieldWidget
+    @property
+    def fields(self):
+        fields = field.Fields(IWfTypedSharedContent).select('title', 'short_name', 'content_url',
+                                                            'data_type', 'header', 'description', 'notepad')
+        fields['title'].widgetFactory = I18nSEOTextLineFieldWidget
+        if not self.context.handle_content_url:
+            fields = fields.omit('content_url')
+        if not self.context.handle_header:
+            fields = fields.omit('header')
+        if not self.context.handle_description:
+            fields = fields.omit('description')
+        return fields