# HG changeset patch # User Thierry Florac # Date 1535635683 -7200 # Node ID 64e8226f8797ea51a1c949d617941b38fa47033b # Parent e853c2a81d3f228972d229cc7dff3a17fcc66036 Updated basic illustration edit form diff -r e853c2a81d3f -r 64e8226f8797 src/pyams_content/component/illustration/zmi/__init__.py --- a/src/pyams_content/component/illustration/zmi/__init__.py Thu Aug 30 11:51:53 2018 +0200 +++ b/src/pyams_content/component/illustration/zmi/__init__.py Thu Aug 30 15:28:03 2018 +0200 @@ -51,15 +51,31 @@ css_class = 'form-group' padding_class = '' - fieldset_class = 'bordered margin-top-10 padding-y-5' + # fieldset_class = 'bordered margin-top-10 padding-y-5' legend = _("Illustration") - legend_class = 'illustration switcher no-y-padding padding-right-10' + # legend_class = 'illustration switcher no-y-padding padding-right-10' fields = field.Fields(IBasicIllustration).omit('__parent__', '__name__') weight = 10 + @property + def legend_class(self): + if IBaseParagraph.providedBy(self.context): + return 'illustration switcher no-y-padding padding-right-10 pull-left width-auto' + else: + return 'illustration switcher no-y-padding' + + @property + def fieldset_class(self): + result = 'margin-top-10 padding-y-5' + if not IBaseParagraph.providedBy(self.context): + result += ' bordered' + return result + + hide_widgets_prefix_div = True + def getContent(self): return IIllustration(self.context) @@ -69,9 +85,10 @@ @property def switcher_state(self): - content = self.getContent() - if content.has_data(): - return 'open' + if not IBaseParagraph.providedBy(self.context): + content = self.getContent() + if content.has_data(): + return 'open' def get_ajax_output(self, changes): output = super(BasicIllustrationPropertiesInnerEditForm, self).get_ajax_output(changes) @@ -102,22 +119,6 @@ return _("Header illustration") @property - def legend_class(self): - if IBaseParagraph.providedBy(self.context): - return 'illustration switcher no-y-padding padding-right-10 pull-left width-auto' - else: - return 'illustration switcher no-y-padding' - - @property - def fieldset_class(self): - result = 'margin-top-10 padding-y-5' - if not IBaseParagraph.providedBy(self.context): - result += ' bordered' - return result - - hide_widgets_prefix_div = True - - @property def switcher_state(self): if not IBaseParagraph.providedBy(self.context): return 'open'