# HG changeset patch # User Thierry Florac # Date 1479199767 -3600 # Node ID e5d6ea4dc8399d28ae31065fae499d2298ff237e # Parent da1454d7d35863edea63f6241d3f64e2746f82a9 Changed widget CSS class attribute diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/component/extfile/zmi/__init__.py --- a/src/pyams_content/component/extfile/zmi/__init__.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/component/extfile/zmi/__init__.py Tue Nov 15 09:49:27 2016 +0100 @@ -92,7 +92,8 @@ def updateWidgets(self, prefix=None): super(ExtFileAddForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' def create(self, data): factory = EXTERNAL_FILES_FACTORIES.get(data.get('factory')) @@ -160,7 +161,8 @@ def updateWidgets(self, prefix=None): super(ExtFilePropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' def update_content(self, content, data): changes = super(ExtFilePropertiesEditForm, self).update_content(content, data) diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/component/gallery/zmi/__init__.py --- a/src/pyams_content/component/gallery/zmi/__init__.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/component/gallery/zmi/__init__.py Tue Nov 15 09:49:27 2016 +0100 @@ -81,8 +81,10 @@ def updateWidgets(self, prefix=None): super(GalleryAddForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' - self.widgets['author_comments'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' + if 'author_comments' in self.widgets: + self.widgets['author_comments'].widget_css_class = 'textarea' def create(self, data): gallery = Gallery() @@ -165,7 +167,8 @@ def updateWidgets(self, prefix=None): super(GalleryPropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.comments: + self.widgets['description'].widget_css_class = 'textarea' @view_config(name='properties.json', context=IGallery, request_type=IPyAMSLayer, diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/component/gallery/zmi/gallery.py --- a/src/pyams_content/component/gallery/zmi/gallery.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/component/gallery/zmi/gallery.py Tue Nov 15 09:49:27 2016 +0100 @@ -83,7 +83,8 @@ def updateWidgets(self, prefix=None): super(GalleryImageAddForm, self).updateWidgets(prefix) - self.widgets['author_comments'].label_css_class = 'textarea' + if 'author_comments' in self.widgets: + self.widgets['author_comments'].widget_css_class = 'textarea' def create(self, data): medias = [] @@ -195,9 +196,12 @@ def updateWidgets(self, prefix=None): super(GalleryFilePropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' - self.widgets['author_comments'].label_css_class = 'textarea' - self.widgets['sound_description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' + if 'author_comments' in self.widgets: + self.widgets['author_comments'].widget_css_class = 'textarea' + if 'sound_description' in self.widgets: + self.widgets['sound_description'].widget_css_class = 'textarea' @view_config(name='gallery-file-properties.json', context=IGalleryFile, request_type=IPyAMSLayer, diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/component/links/zmi/__init__.py --- a/src/pyams_content/component/links/zmi/__init__.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/component/links/zmi/__init__.py Tue Nov 15 09:49:27 2016 +0100 @@ -78,7 +78,8 @@ def updateWidgets(self, prefix=None): super(InternalLinkAddForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' def create(self, data): return InternalLink() @@ -128,7 +129,8 @@ def updateWidgets(self, prefix=None): super(InternalLinkPropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' @view_config(name='properties.json', context=IInternalLink, request_type=IPyAMSLayer, @@ -183,7 +185,8 @@ def updateWidgets(self, prefix=None): super(ExternalLinkAddForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' def create(self, data): return ExternalLink() @@ -233,7 +236,8 @@ def updateWidgets(self, prefix=None): super(ExternalLinkPropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' @view_config(name='properties.json', context=IExternalLink, request_type=IPyAMSLayer, @@ -289,7 +293,8 @@ def updateWidgets(self, prefix=None): super(MailtoLinkAddForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' def create(self, data): return MailtoLink() @@ -339,7 +344,8 @@ def updateWidgets(self, prefix=None): super(MailtoLinkPropertiesEditForm, self).updateWidgets(prefix) - self.widgets['description'].label_css_class = 'textarea' + if 'description' in self.widgets: + self.widgets['description'].widget_css_class = 'textarea' @view_config(name='properties.json', context=IMailtoLink, request_type=IPyAMSLayer, diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/component/paragraph/zmi/html.py --- a/src/pyams_content/component/paragraph/zmi/html.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/component/paragraph/zmi/html.py Tue Nov 15 09:49:27 2016 +0100 @@ -79,7 +79,8 @@ def updateWidgets(self, prefix=None): super(HTMLParagraphAddForm, self).updateWidgets(prefix) - self.widgets['body'].label_css_class = 'textarea' + if 'body' in self.widgets: + self.widgets['body'].widget_css_class = 'textarea' def create(self, data): return HTMLParagraph() @@ -120,10 +121,11 @@ def updateWidgets(self, prefix=None): super(HTMLParagraphPropertiesEditForm, self).updateWidgets(prefix) - for lang in self.widgets['body'].langs: - widget = self.widgets['body'].widgets[lang] - widget.id = '{id}_{name}'.format(id=widget.id, name=self.context.__name__) - self.widgets['body'].label_css_class = 'textarea' + if 'body' in self.widgets: + for lang in self.widgets['body'].langs: + widget = self.widgets['body'].widgets[lang] + widget.id = '{id}_{name}'.format(id=widget.id, name=self.context.__name__) + self.widgets['body'].widget_css_class = 'textarea' @adapter_config(context=(IHTMLParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/shared/common/zmi/__init__.py --- a/src/pyams_content/shared/common/zmi/__init__.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/shared/common/zmi/__init__.py Tue Nov 15 09:49:27 2016 +0100 @@ -76,8 +76,10 @@ def updateWidgets(self, prefix=None): super(SharedContentAddForm, self).updateWidgets(prefix) - self.widgets['title'].description = _("This title can be modified afterwards") - self.widgets['notepad'].label_css_class = 'textarea' + if 'title' in self.widgets: + self.widgets['title'].description = _("This title can be modified afterwards") + if 'notepad' in self.widgets: + self.widgets['notepad'].widget_css_class = 'textarea' def create(self, data): return self.context.shared_content_factory.content_class() @@ -264,7 +266,8 @@ def updateWidgets(self, prefix=None): super(WfSharedContentDuplicateForm, self).updateWidgets(prefix) - self.widgets['comment'].label_css_class = 'textarea' + if 'comment' in self.widgets: + self.widgets['comment'].widget_css_class = 'textarea' def updateActions(self): super(WfSharedContentDuplicateForm, self).updateActions() diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/shared/common/zmi/properties.py --- a/src/pyams_content/shared/common/zmi/properties.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/shared/common/zmi/properties.py Tue Nov 15 09:49:27 2016 +0100 @@ -80,9 +80,9 @@ def updateWidgets(self, prefix=None): super(SharedContentPropertiesEditForm, self).updateWidgets(prefix) if 'description' in self.widgets: - self.widgets['description'].label_css_class = 'textarea' + self.widgets['description'].widget_css_class = 'textarea' if 'notepad' in self.widgets: - self.widgets['notepad'].label_css_class = 'textarea' + self.widgets['notepad'].widget_css_class = 'textarea' @view_config(name='properties.json', context=IWfSharedContent, request_type=IPyAMSLayer, diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/shared/common/zmi/review.py --- a/src/pyams_content/shared/common/zmi/review.py Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/shared/common/zmi/review.py Tue Nov 15 09:49:27 2016 +0100 @@ -110,8 +110,9 @@ def updateWidgets(self, prefix=None): super(WfSharedContentReviewForm, self).updateWidgets(prefix) - self.widgets['comment'].label_css_class = 'textarea' - self.widgets['comment'].addClass('height-100') + if 'comment' in self.widgets: + self.widgets['comment'].widget_css_class = 'textarea' + self.widgets['comment'].addClass('height-100') def updateActions(self): super(WfSharedContentReviewForm, self).updateActions() diff -r da1454d7d358 -r e5d6ea4dc839 src/pyams_content/shared/common/zmi/templates/advanced-search.pt --- a/src/pyams_content/shared/common/zmi/templates/advanced-search.pt Tue Nov 15 09:47:14 2016 +0100 +++ b/src/pyams_content/shared/common/zmi/templates/advanced-search.pt Tue Nov 15 09:49:27 2016 +0100 @@ -74,7 +74,7 @@