src/pyams_content/component/paragraph/zmi/video.py
changeset 544 6928ddfc1c0f
parent 527 5dd1aa8bedd9
child 550 9658debb49a3
equal deleted inserted replaced
543:2125a235d3a0 544:6928ddfc1c0f
    77         super(VideoParagraphAddForm, self).updateWidgets(prefix)
    77         super(VideoParagraphAddForm, self).updateWidgets(prefix)
    78         if 'description' in self.widgets:
    78         if 'description' in self.widgets:
    79             self.widgets['description'].widget_css_class = 'textarea'
    79             self.widgets['description'].widget_css_class = 'textarea'
    80         if 'body' in self.widgets:
    80         if 'body' in self.widgets:
    81             self.widgets['body'].label = ''
    81             self.widgets['body'].label = ''
    82             self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
    82             
    83                                              bordered=False,
    83     def updateGroups(self):
    84                                              legend=_("HTML content"),
    84         self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
    85                                              css_class='inner switcher padding-right-10 no-y-padding pull-left',
    85                                          bordered=False,
    86                                              switch=True,
    86                                          legend=_("HTML content"),
    87                                              hide_if_empty=True))
    87                                          css_class='inner switcher padding-right-10 no-y-padding pull-left',
    88             self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
    88                                          switch=True,
    89                                              ('description', 'author', 'data', 'renderer'),
    89                                          hide_if_empty=True))
    90                                              bordered=False))
    90         self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
       
    91                                          ('description', 'author', 'data', 'renderer'),
       
    92                                          bordered=False))
       
    93         super(VideoParagraphAddForm, self).updateGroups()
    91 
    94 
    92     def create(self, data):
    95     def create(self, data):
    93         return VideoParagraph()
    96         return VideoParagraph()
    94 
    97 
    95     def add(self, object):
    98     def add(self, object):
   123         super(VideoParagraphPropertiesEditForm, self).updateWidgets(prefix)
   126         super(VideoParagraphPropertiesEditForm, self).updateWidgets(prefix)
   124         if 'description' in self.widgets:
   127         if 'description' in self.widgets:
   125             self.widgets['description'].widget_css_class = 'textarea'
   128             self.widgets['description'].widget_css_class = 'textarea'
   126         if 'body' in self.widgets:
   129         if 'body' in self.widgets:
   127             self.widgets['body'].label = ''
   130             self.widgets['body'].label = ''
   128             self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
   131             
   129                                              bordered=False,
   132     def updateGroups(self):
   130                                              fieldset_class='margin-top-10 padding-y-5',
   133         self.add_group(NamedWidgetsGroup(self, 'body_group', self.widgets, ('body',),
   131                                              legend=_("HTML content"),
   134                                          bordered=False,
   132                                              css_class='inner switcher padding-right-10 no-y-padding pull-left',
   135                                          fieldset_class='margin-top-10 padding-y-5',
   133                                              switch=True,
   136                                          legend=_("HTML content"),
   134                                              hide_if_empty=True))
   137                                          css_class='inner switcher padding-right-10 no-y-padding pull-left',
   135             self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
   138                                          switch=True,
   136                                              ('description', 'author', 'data', 'renderer'),
   139                                          hide_if_empty=True))
   137                                              bordered=False))
   140         self.add_group(NamedWidgetsGroup(self, 'data_group', self.widgets,
       
   141                                          ('description', 'author', 'data', 'renderer'),
       
   142                                          bordered=False))
       
   143         super(VideoParagraphPropertiesEditForm, self).updateGroups()
   138 
   144 
   139 
   145 
   140 @view_config(name='properties.json', context=IVideoParagraph, request_type=IPyAMSLayer,
   146 @view_config(name='properties.json', context=IVideoParagraph, request_type=IPyAMSLayer,
   141              permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
   147              permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
   142 class VideoParagraphPropertiesAJAXEditForm(BaseParagraphAJAXEditForm, VideoParagraphPropertiesEditForm):
   148 class VideoParagraphPropertiesAJAXEditForm(BaseParagraphAJAXEditForm, VideoParagraphPropertiesEditForm):