diff --git a/shared/web/ObjectsWeb.py b/shared/web/ObjectsWeb.py index a9129e5a..3762a666 100644 --- a/shared/web/ObjectsWeb.py +++ b/shared/web/ObjectsWeb.py @@ -469,25 +469,26 @@ class ObjectsWebMixin(AdministrableWebMixin): widget = slot.getWidget() form += widget.getModelPageBodyLayout(slot, fields = None) - buttonsBar = X.div(_class = 'buttons-bar') - form += buttonsBar - actionButtonsBar = X.span(_class = 'action-buttons-bar') - buttonsBar += actionButtonsBar - if not object.id: - actionButtonsBar += X.buttonInForm('create', 'createButton') - else: - # The button Delete is also added here, so that the user can - # delete the object he is editing without having to make it - # valid, clic modify and then delete it. - if self.canDeleteObject(object.id): - actionButtonsBar += X.buttonStandalone( - 'delete', X.idUrl(object.id, 'confirmDelete')) - actionButtonsBar += X.buttonInForm('modify', 'modifyButton') + form += X.div(_class = 'buttons-bar')(self.getEditButtons(object)) return writePageLayout(layout, headerTitle) finally: context.pull(_level = 'edit') + def getEditButtons(self, object): + array = X.array() + if not object.id: + array += X.buttonInForm('create', 'createButton') + else: + # The button Delete is also added here, so that the user can + # delete the object he is editing without having to make it + # valid, clic modify and then delete it. + if self.canDeleteObject(object.id): + array += X.buttonStandalone( + 'delete', X.idUrl(object.id, 'confirmDelete')) + array += X.buttonInForm('modify', 'modifyButton') + return array + def getEditLeadIn(self, object): return None