src/pyams_content/component/illustration/zmi/paragraph.py
changeset 536 1e10e634ec13
parent 527 5dd1aa8bedd9
child 550 9658debb49a3
equal deleted inserted replaced
535:d01efcb4d332 536:1e10e634ec13
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
     9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
    10 # FOR A PARTICULAR PURPOSE.
    10 # FOR A PARTICULAR PURPOSE.
    11 #
    11 #
       
    12 from zope.schema._schema import getFieldNamesInOrder
    12 
    13 
    13 __docformat__ = 'restructuredtext'
    14 __docformat__ = 'restructuredtext'
    14 
    15 
    15 
    16 
    16 # import standard library
    17 # import standard library
    68 
    69 
    69     legend = _("Add new illustration")
    70     legend = _("Add new illustration")
    70     dialog_class = 'modal-large'
    71     dialog_class = 'modal-large'
    71     icon_css_class = 'fa fa-fw fa-file-image-o'
    72     icon_css_class = 'fa fa-fw fa-file-image-o'
    72 
    73 
    73     fields = field.Fields(IIllustrationParagraph).omit('__parent__', '__name__', 'visible')
    74     fields = field.Fields(IIllustrationParagraph).select('data', 'title', 'alt_title', 'description',
       
    75                                                          'author', 'renderer')
    74     ajax_handler = 'add-illustration.json'
    76     ajax_handler = 'add-illustration.json'
    75     edit_permission = MANAGE_CONTENT_PERMISSION
    77     edit_permission = MANAGE_CONTENT_PERMISSION
    76 
    78 
    77     def updateWidgets(self, prefix=None):
    79     def updateWidgets(self, prefix=None):
    78         super(IllustrationAddForm, self).updateWidgets(prefix)
    80         super(IllustrationAddForm, self).updateWidgets(prefix)
   101 
   103 
   102     legend = _("Edit illustration properties")
   104     legend = _("Edit illustration properties")
   103     dialog_class = 'modal-large'
   105     dialog_class = 'modal-large'
   104     icon_css_class = 'fa fa-fw fa-file-image-o'
   106     icon_css_class = 'fa fa-fw fa-file-image-o'
   105 
   107 
   106     fields = field.Fields(IIllustrationParagraph).omit('__parent__', '__name__', 'visible')
   108     fields = field.Fields(IIllustrationParagraph).select('data', 'title', 'alt_title', 'description',
       
   109                                                          'author', 'renderer')
   107     fields['renderer'].widgetFactory = RendererFieldWidget
   110     fields['renderer'].widgetFactory = RendererFieldWidget
   108 
   111 
   109     ajax_handler = 'properties.json'
   112     ajax_handler = 'properties.json'
   110     edit_permission = MANAGE_CONTENT_PERMISSION
   113     edit_permission = MANAGE_CONTENT_PERMISSION
   111 
   114