mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Control the headline of forms to say "New" and "Edit" depending
on what we're actually doing.
This commit is contained in:
@ -122,6 +122,7 @@ Note that a community account is only needed if you want to submit information -
|
||||
content is available for reading without an account.
|
||||
""",
|
||||
'savebutton': 'Sign up',
|
||||
'operation': 'New',
|
||||
}, NavContext(request, 'account'))
|
||||
|
||||
|
||||
|
@ -51,6 +51,7 @@ def simple_form(instancetype, itemid, request, formclass, formtemplate='base/for
|
||||
'markdownfields': markdownfields,
|
||||
'form_intro': hasattr(form, 'form_intro') and form.form_intro or None,
|
||||
'savebutton': (itemid == "new") and "New" or "Save",
|
||||
'operation': (itemid == "new") and "New" or "Edit",
|
||||
}, NavContext(request, navsection))
|
||||
|
||||
def template_to_string(templatename, attrs = {}):
|
||||
|
@ -1,6 +1,6 @@
|
||||
{%extends "base/page.html"%}
|
||||
{%block contents%}
|
||||
<h1>Edit {{formitemtype}}</h1>
|
||||
<h1>{{operation|default:"Edit"}} {{formitemtype}}</h1>
|
||||
<form method="post" action=".">
|
||||
{%if form_intro%}
|
||||
<p>
|
||||
|
Reference in New Issue
Block a user