From 8ad008a32fc96a00e8189d0ef18d3127b665425b Mon Sep 17 00:00:00 2001 From: fpeters <> Date: Sat, 17 Apr 2004 20:25:10 +0000 Subject: [PATCH] =?UTF-8?q?les=20boutons=20affich=C3=A9s=20en=20bas=20d'un?= =?UTF-8?q?=20formulaire=20sont=20isol=C3=A9s=20dans=20une=20m=C3=A9thode;?= =?UTF-8?q?=20qui=20pourra=20=C3=AAtre=20surcharg=C3=A9e=20plus=20tard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/web/ObjectsWeb.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) 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