{% macro form_field_with_xpath(label, field_key, elem, has_next=False) %}
{% endmacro %} {% macro multi_input(type, heading, elements, version=1) %}
{% for item in elements or [None] %} {% if version == 1 %}
{{ form_field_with_xpath('ID', 'id', item.get('id') if item) }} {{ form_field_with_xpath('URL', 'url', item.get('url') if item) }} {{ form_field_with_xpath('Value', 'value', item.get('value') if item, has_next=loop.nextitem) }}
{% elif version == 2 %}
{% endif %} {% endfor %} {% endmacro %} {% macro xpath_or_value_input(heading, input_name, item, collection_parser, is_subsection=True) %}
{{ collection_parser.test_xpath(item['xpath'])['count']['percentage'] if item['xpath'] else '-' }}
{% endmacro %}