Close menu

Pattern Library

{% extends "patterns/base.html" %}

{% block content %}
<form method="post" class="form">
    {% csrf_token %}
    <div class="form__container">
        {% if form.errors %}
            <div class="form__errors">
                There were some errors with your form. Please amend the fields highlighted below.

                {% if form.non_field_errors %}
                    <ul>
                    {% for error in form.non_field_errors %}
                        <li>{{ error }}</li>
                    {% endfor %}
                    </ul>
                {% endif %}
            </div>
        {% endif %}

        {% for hidden_field in form.hidden_fields %}
            {{ hidden_field }}
        {% endfor %}

        {% for field in form.visible_fields %}
            {% include "patterns/molecules/field/field.html" with field=field %}
        {% endfor %}

        <button class="form__submit button" type="submit">Submit</button>
    </div>
</form>
{% endblock %}