{% import 'input/field.html' as field %} {# generate methods #} {% macro generate_container(cont) %} {% if cont.type == 'vertical' %} {{ vertical_container(cont) }} {% elif cont.type == 'pairs' %} {{ pairs_container(cont) }} {% elif cont.type == 'label' %} {{ label_container(cont) }} {% endif %} {% endmacro %} {% macro generate_widget(wid, id=none) %} {% if wid.type == 'text' %} {{ text_widget(wid, id=id) }} {% elif wid.type == 'label' %} {{ label_widget(wid) }} {% elif wid.type == 'string' %} {{ string_widget(wid, id=id) }} {% elif wid.type == 'textbox' %} {{ textbox_widget(wid, id=id) }} {% elif wid.type == 'list' %} {{ list_widget(wid, id=id) }} {% endif %} {% endmacro %} {% macro generate_children(cont) %} {% for child in cont.children %} {% if child.category == 'container' %} {{ generate_container(child) }} {% else %} {{ generate_widget(child) }} {% endif %} {% endfor %} {% endmacro %} {% macro generate(xmlui) %} {{ generate_container(xmlui.main_cont) }} {% endmacro %} {# containers #} {% macro vertical_container(cont) %}