src/Elements/Bundle/DemiFrontendBundle/Resources/views/AdditionalService/detail/serviceInfoCollapse.html.twig line 1

Open in your IDE?
  1. <section class="additional-service__block">
  2.     <h2 class="js-toc__title additional-service__hl">{{ detailHeadline }}</h2>
  3.     <div class="additional-service__body">
  4.         {% if detailText is not empty %}
  5.             <div class="mb-4">
  6.                 <div class="wysiwyg">{{ detailText|raw }}</div>
  7.             </div>
  8.         {% endif %}
  9.         {% if (moreDescriptions and not moreDescriptions is empty) or (localDescriptions and not localDescriptions is empty) %}
  10.             {% set count = 0 %}
  11.             <div class="accordion accordion--demi-additionalservice" id="accordionServiceInfo">
  12.                 {% if moreDescriptions and not moreDescriptions is empty %}
  13.                     {% set moreDescriptions = demi_array_intersect(demi_additionalGetSortedDescriptionTypes(), moreDescriptions) %}
  14.                         {% for type in moreDescriptions %}
  15.                             {% set tk = ('demi.additionalservice.detail.' ~ demi_getValidFileName(type))|lower %}
  16.                             {% set count = count + 1 %}
  17.                             {% set identifier = "addtionalservicedescription-" ~ count %}
  18.                             {{ _self.card(tk, identifier, offerItem.getDescription(type, app.request.locale)) }}
  19.                         {% endfor %}
  20.                 {% endif %}
  21.                 {% if localDescriptions and not localDescriptions is empty %}
  22.                     {% set count = count > 0 ? count : 0 %}
  23.                     {% for description in localDescriptions %}
  24.                         {% set tk = ('demi.additionalservice.detail.' ~ demi_getValidFileName(description.getProperty('demi_descriptionType')))|lower %}
  25.                         {% set count = count + 1 %}
  26.                         {% set identifier = "addtionalservicedescription-" ~ count %}
  27.                         {{ _self.card(tk, identifier, description.getText()) }}
  28.                     {% endfor %}
  29.                 {% endif %}
  30.             </div>
  31.         {% endif %}
  32.     </div>
  33. </section>
  34. {% macro card(tk, identifier, description) %}
  35.     <div class="card">
  36.         <div class="card-header" id="heading-{{ identifier }}">
  37.             <h5 class="mb-0">
  38.                 <a class="text-left d-block text-primary collapsed" href="#collapse-{{ identifier }}" data-toggle="collapse"
  39.                    data-target="#collapse-{{ identifier }}" aria-expanded="false" aria-controls="collapse-{{ identifier }}">
  40.                     {{ tk|trans }}
  41.                     <span class="demi-icon demi-icon-plus fz11 mt-1 float-right" aria-hidden="true"></span>
  42.                 </a>
  43.             </h5>
  44.         </div>
  45.         <div id="collapse-{{ identifier }}" class="collapse" aria-labelledby="heading-{{ identifier }}" data-parent="#accordionServiceInfo">
  46.             <div class="card-body">
  47.                 <div class="wysiwyg">{{ description|raw }}</div>
  48.             </div>
  49.         </div>
  50.     </div>
  51. {% endmacro %}