{% macro render_extra_fields(fields, show_labels=True, show_optionals=True, show_descriptions=True) -%} {% for field in fields %}
{% if field.field_type == "text" %} {% if show_labels %} {{ field.label }} {% endif %} {% if show_optionals %} {% if field.flags.required is false %} Optional {% endif %} {% endif %} {{ field(class="form-control") }} {% if show_descriptions %} {% if field.description %} {{ field.description }} {% endif %} {% endif %} {% elif field.field_type == "boolean" %}
{{ field(class="form-check-input") }} {{ field.label(class="form-check-label") }} {% if show_optionals %} {% if field.flags.required is false %} Optional {% endif %} {% endif %}
{% if show_descriptions %} {% if field.description %} {{ field.description }} {% endif %} {% endif %} {% elif field.field_type == "select" %}
{{ field.label(class="form-label") }} {% if show_optionals %} {% if field.flags.required is false %} {% trans %}(Optional){% endtrans %} {% endif %} {% endif %}
{{ field(class="form-control form-select custom-select") }} {% if show_descriptions %} {% if field.description %} {{ field.description }} {% endif %} {% endif %} {% endif %}
{% endfor %} {%- endmacro %}