mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-13 13:12:42 +00:00
Support short introductory text on a form driven from the model,
without the need to create a separate template. (Anything more advanced should still use a template, of course)
This commit is contained in:
@ -38,5 +38,6 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
|
||||
'form': form,
|
||||
'formitemtype': instance._meta.verbose_name,
|
||||
'markdownfields': markdownfields,
|
||||
'form_intro': hasattr(form, 'form_intro') and form.form_intro or None,
|
||||
}, NavContext(request, navsection))
|
||||
|
||||
|
@ -2,6 +2,12 @@
|
||||
{%block contents%}
|
||||
<h1>Edit {{formitemtype}}</h1>
|
||||
<form method="post" action=".">
|
||||
{%if form_intro%}
|
||||
<p>
|
||||
{{form_intro|safe}}
|
||||
</p>
|
||||
{%endif%}
|
||||
|
||||
<table class="pgGenericFormTable">
|
||||
{{form.as_table}}
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user