{% import 'macros/form.html' as form %} {% macro help_text() %} {%- snippet 'scheming/form_snippets/help_text.html', field=field -%} {% endmacro %} {%- call form.input_block( "field-" + field.field_name, label=h.scheming_language_text(field.label), classes=field.classes if 'classes' in field else ['control-full'], error=errors[field.field_name], is_required=h.scheming_field_required(field), extra_html=help_text() ) -%} {%- set choices = [] -%} {%- for c in h.scheming_field_choices(field) -%} {%- do choices.append( (c.value, h.scheming_language_text(c.label))) -%} {%- endfor -%} {%- if field.get('sorted_choices') -%} {%- set choices = choices|sort(case_sensitive=false, attribute=1) -%} {%- endif -%} {%- endcall -%}