{# templates/form.html #} {% set key = item.key %} {% macro input(item, type='text', class='api', name='name') %} {{ item.name }}{{ add }} {% endmacro %} {% block form_render %} {% if item.get("elem") == "hex_info" %} {{ label(item, add=':') }} {{ input(item, class='content api') }} data-hex readonly /> {% elif item.get("elem") == "label" %} {{ label(item, class='') }} {% elif item.get("elem") == "range" %}
{{ label(item, add='=') }} {{ input(item, class='input-inline', type='number', name='aInput') }} readonly oninput="this.form.aRange{{ key }}.value=this.value" /> {{ input(item, class='range api', type='range', name='aRange') }} min="{{ item.values.min }}" max="{{ item.values.max }}" oninput="this.form.aInput{{key}}.value=this.value" />
{% elif item.get("elem") == "checkbox" %}
{{ label(item) }} {{ input(item, type="checkbox") }} />
{% elif item["values"] %} {{ label(item, class='') }}
{% else %} {{ label(item, class='') }} {{ input(item) }} /> {% endif %} {% endblock %}