equal
deleted
inserted
replaced
249 |
249 |
250 @view_config(name='extfile-links.json', context=IExtFileLinksContainerTarget, request_type=IPyAMSLayer, |
250 @view_config(name='extfile-links.json', context=IExtFileLinksContainerTarget, request_type=IPyAMSLayer, |
251 permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) |
251 permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True) |
252 class ExtFileLinksContainerAJAXEditForm(AJAXEditForm, ExtFileLinksContainerLinksEditForm): |
252 class ExtFileLinksContainerAJAXEditForm(AJAXEditForm, ExtFileLinksContainerLinksEditForm): |
253 """External file links container edit form, JSON renderer""" |
253 """External file links container edit form, JSON renderer""" |
|
254 |
|
255 def get_ajax_output(self, changes): |
|
256 if 'files' in changes.get(IExtFileLinksContainer, ()): |
|
257 return {'status': 'success', |
|
258 'event': 'PyAMS_content.changed_item', |
|
259 'event_options': {'object_type': 'extfiles_container', |
|
260 'object_name': self.context.__name__, |
|
261 'nb_files': len(IExtFileLinksContainer(self.context).files or ())}} |
|
262 else: |
|
263 return super(ExtFileLinksContainerAJAXEditForm, self).get_ajax_output(changes) |