{% macro render_form(form, state) -%} {% for field in form %} {{ row(field, state=state, **kwargs) }} {% endfor %} {%- endmacro %} {% macro row(field, state='view') -%}