mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Make the base form support different names for the save button
This commit is contained in:
@ -117,6 +117,7 @@ def signup(request):
|
||||
'form': form,
|
||||
'formitemtype': 'Account',
|
||||
'form_intro': 'This is the intro text',
|
||||
'savebutton': 'Sign up',
|
||||
}, NavContext(request, 'account'))
|
||||
|
||||
|
||||
|
@ -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 = {}):
|
||||
|
@ -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%}
|
||||
|
||||
|
Reference in New Issue
Block a user