equal
deleted
inserted
replaced
241 icon_css_class = 'fa fa-fw fa-pencil-square-o' |
241 icon_css_class = 'fa fa-fw fa-pencil-square-o' |
242 |
242 |
243 fields = field.Fields(IFormField).omit('__parent__', '__name__', 'visible') |
243 fields = field.Fields(IFormField).omit('__parent__', '__name__', 'visible') |
244 edit_permission = MANAGE_CONTENT_PERMISSION |
244 edit_permission = MANAGE_CONTENT_PERMISSION |
245 |
245 |
246 def updateWidgets(self, prefix=None): |
|
247 super(FormFieldAddForm, self).updateWidgets(prefix) |
|
248 if 'description' in self.widgets: |
|
249 self.widgets['description'].widget_css_class = 'textarea' |
|
250 |
|
251 def create(self, data): |
246 def create(self, data): |
252 return FormField() |
247 return FormField() |
253 |
248 |
254 def add(self, object): |
249 def add(self, object): |
255 IFormFieldContainer(self.context)[object.name] = object |
250 IFormFieldContainer(self.context)[object.name] = object |
288 |
283 |
289 def updateWidgets(self, prefix=None): |
284 def updateWidgets(self, prefix=None): |
290 super(FormFieldPropertiesEditForm, self).updateWidgets(prefix) |
285 super(FormFieldPropertiesEditForm, self).updateWidgets(prefix) |
291 if 'name' in self.widgets: |
286 if 'name' in self.widgets: |
292 self.widgets['name'].mode = DISPLAY_MODE |
287 self.widgets['name'].mode = DISPLAY_MODE |
293 if 'description' in self.widgets: |
|
294 self.widgets['description'].widget_css_class = 'textarea' |
|
295 |
288 |
296 def get_ajax_output(self, changes): |
289 def get_ajax_output(self, changes): |
297 output = super(self.__class__, self).get_ajax_output(changes) |
290 output = super(self.__class__, self).get_ajax_output(changes) |
298 if 'label' in changes.get(IFormField, ()): |
291 if 'label' in changes.get(IFormField, ()): |
299 output.setdefault('events', []).append({ |
292 output.setdefault('events', []).append({ |