Make the base form support different names for the save button

This commit is contained in:
Magnus Hagander
2010-02-27 02:06:15 +01:00
parent 0e57a048dd
commit 587bda6b9f
3 changed files with 3 additions and 1 deletions

View File

@ -117,6 +117,7 @@ def signup(request):
'form': form,
'formitemtype': 'Account',
'form_intro': 'This is the intro text',
'savebutton': 'Sign up',
}, NavContext(request, 'account'))

View File

@ -50,6 +50,7 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
'formitemtype': instance._meta.verbose_name,
'markdownfields': markdownfields,
'form_intro': hasattr(form, 'form_intro') and form.form_intro or None,
'savebutton': (itemid == "new") and "New" or "Save",
}, NavContext(request, navsection))
def template_to_string(templatename, attrs = {}):

View File

@ -11,7 +11,7 @@
<table class="pgGenericFormTable">
{{form.as_table}}
</table>
<input type="submit" value="Save">
<input type="submit" value="{{savebutton|default:"Save"}}">
</form>
{%endblock%}