Robert Kaussow
f6a2053355
All checks were successful
continuous-integration/drone/push Build is passing
22 lines
723 B
Django/Jinja
22 lines
723 B
Django/Jinja
#jinja2: lstrip_blocks: True
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<service>
|
|
{% if item.short is defined %}
|
|
<short>{{ item.short }}</short>
|
|
{% endif %}
|
|
{% if item.description is defined %}
|
|
<description>{{ item.description }}</description>
|
|
{% endif %}
|
|
{% for tag in item %}
|
|
{# Tags which can be used several times #}
|
|
{% if tag in ["port", "protocol", "source-port", "module"] %}
|
|
{% for subtag in item[tag] %}
|
|
<{{ tag }}{% for name, value in subtag.items() %} {{ name }}="{{ value }}"{% endfor %}/>
|
|
{% endfor %}
|
|
{# Tags which can be used once #}
|
|
{% elif tag in ["destination"] %}
|
|
<{{ tag }}{% for name, value in tag.items() | default({}) %} {{ name }}="{{ value }}"{% endfor %}/>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</service>
|