<commit_before>{% set outIterator2 = 1 %}
{% if outIterator is not defined %}
	{% set outIterator = 0 %}
{% endif %}
{% if outXpath is not defined %}
	{% set outXpath = xpath %}
{% endif %}
{% if hasChildren is not defined %}
	{% set hasChildren = false %}
{% endif %}

{% if element|length %}	
	<div class="level-{{ level }} {{key}}">
		
		{% if key == 'container' %}
			{% set useLevel = true %}
		{% else %}
			{% set useLevel = false %}
		{% endif %}

		{% if element.attributes.config is defined and element.attributes.config == "true" %}
			{% set outIterator = 1 %}
			{% set outXpath = xpath ~ '/*' ~ '[' ~ iterator ~ ']' %}
			{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element, 'xpath': outXpath, 'key': key, 'level': level, 'addLevel': useLevel, 'iterator': iterator, 'hasChildren': hasChildren} %}
		{% else %}
			{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element, 'key': key, 'level': level, 'addLevel': useLevel, 'hasChildren': hasChildren} %}
		{% endif %}
		{% set hasChildren = false %}

		

		{% for key, el in element %}
			{% if element.hasChildren() %}
				{% set outXpath = xpath ~ '/*' ~ '[' ~ iterator ~ ']' %}
				{% include 'FITNetopeerBundle:State:parent.html.twig' with {'element': element.getChildren(), 'xpath': outXpath, 'key': key, 'level': level + 1, 'iterator': outIterator, 'hasChildren': true } %}
			{% else %}
				{# next line is commented because issue #763, please visit for more informations #}
				{# set tmpXpath = outXpath ~ '/*[' ~ outIterator ~ ']/*[' ~ outIterator2 ~ ']' #}

				{% set tmpXpath = outXpath ~ '/*[' ~ outIterator ~ ']' %}

				{% if element.current().attributes.config is defined and element.current().attributes.config == "true" %}
					{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element.current(), 'xpath': tmpXpath, 'key': key, 'level': level + 1, 'addLevel': true, 'iterator': outIterator} %}
				{% else %}
					{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element.current(), 'key': key, 'level': level + 1, 'addLevel': true} %}
				{% endif %}
			{% endif %}
			{% set outIterator = outIterator + 1 %}
			{% set outIterator2 = outIterator2 + 1 %}
		{% endfor %}
	</div>
{% else %}	
	{% if element.attributes.config is defined and element.attributes.config == "true" %}
		{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element, 'xpath': outXpath, 'key': key, 'level': level, 'addLevel': true, 'iterator': iterator } %}
	{% else %}
		{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element, 'key': key, 'level': level, 'addLevel': true} %}
	{% endif %}
{% endif %}
<commit_msg>webgui: repair wrong edti-config query while enabling hanic, refs #763<commit_after>{% set outIterator = 0 %}
{% set outXpath = xpath ~ '/*' ~ '[' ~ iterator ~ ']' %}
{% if hasChildren is not defined %}
	{% set hasChildren = false %}
{% endif %}

{% if element|length %}	
	<div class="level-{{ level }} {{key}}">
		
		{% if key == 'container' %}
			{% set useLevel = true %}
		{% else %}
			{% set useLevel = false %}
		{% endif %}

		{% if element.attributes.config is defined and element.attributes.config == "true" %}
			{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element, 'xpath': outXpath, 'key': key, 'level': level, 'addLevel': useLevel, 'iterator': iterator, 'hasChildren': hasChildren} %}
		{% else %}
			{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element, 'key': key, 'level': level, 'addLevel': useLevel, 'hasChildren': hasChildren} %}
		{% endif %}
		{% set hasChildren = false %}

		

		{% for key, el in element %}
			{% set outIterator = outIterator + 1 %}

			{% if element.hasChildren() %}
				{% include 'FITNetopeerBundle:State:parent.html.twig' with {'element': element.getChildren(), 'xpath': outXpath, 'key': key, 'level': level + 1, 'iterator': outIterator, 'hasChildren': true } %}
			{% else %}
				{# next line is commented because issue #763, please visit for more informations #}
				{#{% set tmpXpath = outXpath ~ '/*[' ~ outIterator ~ ']/*[' ~ outIterator2 ~ ']' %}#}

				{% set tmpXpath = outXpath ~ '/*[' ~ outIterator ~ ']' %}
				{% if element.current().attributes.config is defined and element.current().attributes.config == "true" %}
					{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element.current(), 'xpath': tmpXpath, 'key': key, 'level': level + 1, 'addLevel': true, 'iterator': outIterator} %}
				{% else %}
					{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element.current(), 'key': key, 'level': level + 1, 'addLevel': true} %}
				{% endif %}
			{% endif %}
		{% endfor %}
	</div>
{% else %}	
	{% if element.attributes.config is defined and element.attributes.config == "true" %}
		{% include 'FITNetopeerBundle:Config:leaf.html.twig' with {'element': element, 'xpath': outXpath, 'key': key, 'level': level, 'addLevel': true, 'iterator': iterator } %}
	{% else %}
		{% include 'FITNetopeerBundle:State:leaf.html.twig' with {'element': element, 'key': key, 'level': level, 'addLevel': true} %}
	{% endif %}
{% endif %}

{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.005232558139534884, 'mean_word_length': 4.114965312190288, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4553928', 'n_tokens_mistral': 1986, 'n_tokens_neox': 1637, 'n_words': 442}