{% 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(class="form-label") }} {% endif %} {% if show_optionals %} {% if field.flags.required is false %} {% trans %}(Optional){% endtrans %} {% endif %} {% endif %} {{ field(class="form-control") }} {% if show_descriptions %} {% if field.description %} {{ field.description }} {% endif %} {% endif %}
{% elif field.field_type == "boolean" %}
{{ field.label(class="form-label") }} {% if show_optionals %} {% if field.flags.required is false %} {% trans %}(Optional){% endtrans %} {% endif %} {% endif %}
{{ field(class="form-check-input") }} {{ field.label(class="form-check-label") }}
{% 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-select") }} {% if show_descriptions %} {% if field.description %} {{ field.description }} {% endif %} {% endif %} {% endif %} {% endfor %} {%- endmacro %}