{# #} {% extends 'emails/email-template-plain.html.twig' %} {% block content %} {% macro description(link, text) %} {% if link %} {{text}} {% else %} {{text}} {% endif %} {% endmacro %} {% for line in report %} {% if line.type == 'title' %}
{{line.body}}
{% elseif line.type == 'subtitle' %}
{{line.body}}
{% elseif line.type == 'section' %}
{{line.body}}
{% if report[loop.index].type|default != 'description' %}
{% endif %} {% elseif line.type == 'description' %}
{{line.body}}
{% elseif line.type == 'body' %}
{{line.body}}
{% elseif line.type == 'list' %}
{% for item in line.body %} {% set class = loop.index0 == 0 ? 'report-list-title' : 'report-list-body' %} {% set class = class ~ (loop.last and item.description == 'Total' ? ' report-list-total' : '') %} {% if item.quantity is not defined %}
{{_self.description(item.link|default, item.description|default('missing'))}}
{% else %}
{{item.quantity}}
{{_self.description(item.link|default, item.description|default('missing'))}}
{% endif %}
{{item.amount|default('missing')}}
{% endfor %}
{% else %}
{{line.type}}: {{line.body}}
{% endif %} {% endfor %} {% endblock content %}