{%- import 'lib.html' as lib -%} {%- macro field(): -%} {%- for option in widget.options %} {%- if widget.value == option[0] %} {{ option[1] }} {%- else %} {{ option[1] }} {%- endif %} {%- endfor %} {%- endmacro -%} {% if fragment == 'label' %} {{ lib.label(widget) }} {% elif fragment == 'field' %} {{ field() }} {% else %} {%- block widget %}