mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
Add ability to toggle fields in forms
This uses jQuery to make it possible to enable and disable fields in the default forms, by specifying an attribute on the form class. The form class still has to implement proper validators, so it does not rely on client side validations.
This commit is contained in:
@ -57,6 +57,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,
|
||||
'toggle_fields': hasattr(form, 'toggle_fields') and form.toggle_fields or None,
|
||||
'savebutton': (itemid == "new") and "New" or "Save",
|
||||
'operation': (itemid == "new") and "New" or "Edit",
|
||||
}, NavContext(request, navsection))
|
||||
|
Reference in New Issue
Block a user