{%- macro input(field, icon=none, class=none) %}
{% if icon -%} {%- endif %} {{ field( class="form-control" + (' is-invalid' if field.errors else ''), placeholder=field.label.text) }} {%- if field.errors %}
{%- for error in field.errors %} {{ error }} {%- endfor %}
{%- endif %}
{%- endmacro %} {%- macro radio(field) %}
{{ field.label.text }}
{%- for option in field %}
{{ option(class="form-check-input") }} {{ option.label(class="form-check-label") }}
{%- endfor %}
{%- endmacro %} {%- macro bs_file_icon(mimetype) -%} {%- set type = (mimetype or '').partition('/')[0] -%} {%- if type == 'audio' -%} file-earmark-music {%- elif type == 'image' -%} file-earmark-image {%- elif type == 'video' -%} file-earmark-play {%- elif type == 'text' -%} file-earmark-text {%- else -%} file-earmark {%- endif -%} {%- endmacro -%}