From 7730080afc7032e3382a2d64952e91a309c9009e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 5 Feb 2018 16:53:17 -0600 Subject: [PATCH] Let each form define its "save" button text where applicable etc. --- tailbone/forms2/core.py | 1 + tailbone/templates/forms2/deform.mako | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tailbone/forms2/core.py b/tailbone/forms2/core.py index d5b3cb81..938a40ef 100644 --- a/tailbone/forms2/core.py +++ b/tailbone/forms2/core.py @@ -320,6 +320,7 @@ class Form(object): """ Base class for all forms. """ + save_label = "Save" update_label = "Save" show_cancel = True diff --git a/tailbone/templates/forms2/deform.mako b/tailbone/templates/forms2/deform.mako index ce8a73d0..ef33d686 100644 --- a/tailbone/templates/forms2/deform.mako +++ b/tailbone/templates/forms2/deform.mako @@ -72,7 +72,7 @@ ${h.csrf_token(request)} % elif not readonly:
## ${h.submit('create', form.create_label if form.creating else form.update_label)} - ${h.submit('save', "Save")} + ${h.submit('save', getattr(form, 'save_label', "Save"))} ## % if form.creating and form.allow_successive_creates: ## ${h.submit('create_and_continue', form.successive_create_label)} ## % endif