<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Form</title>
</head>
<body>

<form action="{{ form_action }}" method="post" class="form form-page">
    {% csrf_token %}

    {% if form.page.name %}
        <h2 class="form-page-name">{{ form.page.name }}</h2>
    {% endif %}

    {% if form.page.introduction %}
        <p class="form-page-introduction">{{ form.page.introduction }}</p>
    {% endif %}

    {{ form.hidden_fields|join:'' }}

    {{ form.page }}

    {% comment %}
    {% for fieldset in form.page %}
        <fieldset class="fieldset">
            {% if fieldset.legend %}
                <legend class="legend">{{ fieldset.legend }}</legend>
            {% endif %}
            {% for row in fieldset.rows %}
                <div class="form-row">
                    {% for field in row.fields %}
                        {{ field.errors }}
                        <div class="form-field{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
                            {{ field.label_tag }}
                            {{ field.field }}
                            {{ field.help_text }}
                        </div>
                    {% endfor %}
                </div>
            {% endfor %}
        </fieldset>
    {% endfor %}
    {% endcomment %}

    <p>
        {# Make the 'next' submit the first submit button for when the user presses 'enter'. #}
        <input type="submit" name="{{ next_page_field_name }}" value="{{ _('Submit') }}" />
        {% if form.has_previous_page %}
            <input type="submit" name="{{ previous_page_field_name }}" value="{{ _('Go back') }}">
        {% endif %}
    </p>
</form>

</body>
</html>
