<!--- See https://docs.djangoproject.com/en/5.2/topics/forms/#reusable-form-templates -->

{% load custom_tags %}
{% for field in form %}
    <div class="field">

        <label class="label">
            {{ field.label }}
        </label>
        <div class="control">
            {% if field|widget_type == 'TextInput' %}
                {{ field|add_class:"input" }}
            {% elif field|widget_type == 'Select' %}
                <div class="select">
                    {{ field }}
                </div>
            {% else %}
                {{ field|add_class:"input" }}
            {% endif %}
        </div>
        <div class="help is-danger">
            {{ field.errors }}
        </div>
    </div>

{% endfor %}