{%- endmacro %}
{% macro form_header(form, method='post', action='', orientation='horizontal', id=none, classes='', multipart=false, i_form=true) -%}
{% endmacro %}
{% macro form_fieldset(legend, description=none, disabled=false, render_as_fieldset=true, collapsible=false, initially_collapsed=true) %}
{% if not render_as_fieldset %}
{#
This is sugar for cases where you sometimes want the fieldset
to show up as a fieldset and sometimes just want the contents.
The most common use case for this is a form which has either
a single fieldset or multiple fieldsets depending on the user's
privileges. In this case it often looks better not to show the
single fieldset as an actual fieldset.
Using `render_as_fieldset` keep the code using this macro clean
as it won't need extra conditions/macros/blocks to show the same
content either inside or outside this fieldset.
#}
{{ caller() }}
{% else %}
{% endif %}
{% endmacro %}
{# Renders a form with the most common default markup #}
{% macro simple_form(form, submit=none, back=none, back_url=none, back_button=true, disabled_until_change=true,
disabled_fields=(), form_header_kwargs={}) %}
{% set submit = submit or _('Save') %}
{% set back = back or _('Back') %}
{{ form_header(form, **form_header_kwargs) }}
{{ form_rows(form, disable=disabled_fields) }}
{% call form_footer(form) %}
{% if back_button %}
{% if back_url %}
{{ back }}
{% else %}
{% endif %}
{% endif %}
{% endcall %}
{% endmacro %}