{% extends "base.html" %}
{% macro render_form(form, depth) %}
  {% for field in form %}
    {% if field.type == "FormField"%}
    <div>
      {% if field.data | length > 1 %}
        <h{{ [4, depth + 1] | min}} id="{{ field.id }}">{{ field.label.text }}</h{{ [4, depth + 1] | min}}>
      {% endif %}
      {{ render_form(field, depth + 1) }}
    </div>
    {% elif not field.type in ["CSRFTokenField", "FormField", "SubmitField"] %}
      <div>  
      {{ field.label }}
      {{ field() }}
      </div>
    {%