<section class="additional-service__block">
<h2 class="js-toc__title additional-service__hl">{{ detailHeadline }}</h2>
<div class="additional-service__body">
{% if detailText is not empty %}
<div class="mb-4">
<div class="wysiwyg">{{ detailText|raw }}</div>
</div>
{% endif %}
{% if (moreDescriptions and not moreDescriptions is empty) or (localDescriptions and not localDescriptions is empty) %}
{% set count = 0 %}
<div class="accordion accordion--demi-additionalservice" id="accordionServiceInfo">
{% if moreDescriptions and not moreDescriptions is empty %}
{% set moreDescriptions = demi_array_intersect(demi_additionalGetSortedDescriptionTypes(), moreDescriptions) %}
{% for type in moreDescriptions %}
{% set tk = ('demi.additionalservice.detail.' ~ demi_getValidFileName(type))|lower %}
{% set count = count + 1 %}
{% set identifier = "addtionalservicedescription-" ~ count %}
{{ _self.card(tk, identifier, offerItem.getDescription(type, app.request.locale)) }}
{% endfor %}
{% endif %}
{% if localDescriptions and not localDescriptions is empty %}
{% set count = count > 0 ? count : 0 %}
{% for description in localDescriptions %}
{% set tk = ('demi.additionalservice.detail.' ~ demi_getValidFileName(description.getProperty('demi_descriptionType')))|lower %}
{% set count = count + 1 %}
{% set identifier = "addtionalservicedescription-" ~ count %}
{{ _self.card(tk, identifier, description.getText()) }}
{% endfor %}
{% endif %}
</div>
{% endif %}
</div>
</section>
{% macro card(tk, identifier, description) %}
<div class="card">
<div class="card-header" id="heading-{{ identifier }}">
<h5 class="mb-0">
<a class="text-left d-block text-primary collapsed" href="#collapse-{{ identifier }}" data-toggle="collapse"
data-target="#collapse-{{ identifier }}" aria-expanded="false" aria-controls="collapse-{{ identifier }}">
{{ tk|trans }}
<span class="demi-icon demi-icon-plus fz11 mt-1 float-right" aria-hidden="true"></span>
</a>
</h5>
</div>
<div id="collapse-{{ identifier }}" class="collapse" aria-labelledby="heading-{{ identifier }}" data-parent="#accordionServiceInfo">
<div class="card-body">
<div class="wysiwyg">{{ description|raw }}</div>
</div>
</div>
</div>
{% endmacro %}