0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

[feat] Add reusable templates to generate forms

This commit is contained in:
Shohan 2021-07-22 00:12:26 +05:30 committed by Matt Westcott
parent d6c787fc51
commit 2b09a653d1
3 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<form action="{{ submit_url }}" method="POST">
{% csrf_token %}
{% block form_fields %}{% endblock form_fields %}
<input type="submit" value="{{ action_button_text }}" class="button {{ action_button_class }}" />
<a href="{{ next }}" class="button button-secondary">{{ no_action_button_text }}</a>
</form>

View File

@ -0,0 +1,9 @@
{% extends './form.html' %}
{% block form_fields %}
<ul class="fields">
{% for field in form %}
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
{% endfor %}
</ul>
{% endblock form_fields %}

View File

@ -0,0 +1,2 @@
{% load i18n %}
<a href="{{ next }}" class="button button-secondary">{% trans "Go back" %}</a>