{% load django_listing %}
{% for row in layout %}
    <div class="form-row">
        {% for field_name,_,ending,_ in row %}
            {% if field_name == "_" %}
                <div class="form-field">
                    <div class="label_input"></div>
                </div>
            {% else %}
                {% filters_form_field listing field_name as field %}
                {% get_filter listing field_name as filter %}
                {% if field %}
                    <div {% filters_form_field_container_attrs listing field_name %}>
                        {% if field.errors %}<span class="listing-icon-attention"></span> {{ field.errors }}{% endif %}
                        <div class="label_input {{ filter.form_field_input_container_css }}">
                            {% if filter.reverse_form_label_tag %}
                                {{ field }}{{ field.label_tag }}
                            {% else %}
                                {{ field.label_tag }}{{ field }}
                            {% endif %}
                        </div>
                        {% if ending %}<span class="ending">{{ ending }}</span>{% endif %}
                        {% if field.help_text %}
                            <p class="help">{{ field.help_text|safe }}</p>
                        {% endif %}
                    </div>
                {% else %}
                    *** no filter named '{{ field_name }}' ***
                {% endif %}
            {% endif %}
        {% endfor %}
    </div>
{% endfor %}
