custom/plugins/dkcLocations/src/Resources/views/storefront/page/location-detail.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_content %}
  3.     <div class="dkc-location-detail">
  4.         {# Hero Header - inside container/row/col #}
  5.         <div class="container" style="padding-top: 2rem;">
  6.             <div class="row">
  7.                 <div class="col-12">
  8.                     <div class="dkc-location-detail__hero">
  9.                         <p class="dkc-location-detail__hero-label">Standort</p>
  10.                         <h1 class="dkc-location-detail__hero-title">{{ location.name }}</h1>
  11.                     </div>
  12.                 </div>
  13.             </div>
  14.         </div>
  15.         <div class="container dkc-location-detail__content">
  16.             <div class="row dkc-location-detail__row">
  17.                 {# Left: Contact info #}
  18.                 <div class="col-12 col-md-5 col-lg-4 mb-4 mb-md-0 dkc-location-detail__info-col">
  19.                     <div class="dkc-location-detail__info-box">
  20.                         {% if location.company %}
  21.                             <p class="dkc-location-detail__company">{{ location.company }}</p>
  22.                         {% endif %}
  23.                         <p class="dkc-location-detail__address">
  24.                             {{ location.street }}<br>
  25.                             {{ location.zipcode }} {{ location.city }}
  26.                             {% if location.country %}
  27.                                 <br>{{ location.country.translated.name|default(location.country.name) }}
  28.                             {% endif %}
  29.                         </p>
  30.                         <div class="dkc-location-detail__contact">
  31.                             {% if location.phone %}
  32.                                 <p><strong>Telefon:</strong> <a href="tel:{{ location.phone }}">{{ location.phone }}</a></p>
  33.                             {% endif %}
  34.                             {% if location.fax %}
  35.                                 <p><strong>Fax:</strong> {{ location.fax }}</p>
  36.                             {% endif %}
  37.                             {% if location.email %}
  38.                                 <p><strong>E-Mail:</strong> <a href="mailto:{{ location.email }}">{{ location.email }}</a></p>
  39.                             {% endif %}
  40.                         </div>
  41.                         {% if location.openingHours %}
  42.                             <div class="dkc-location-detail__section-divider">
  43.                                 <p class="dkc-location-detail__section-title">Öffnungszeiten:</p>
  44.                                 <div class="dkc-location-detail__section-content">{{ location.openingHours|raw }}</div>
  45.                             </div>
  46.                         {% endif %}
  47.                         {% if location.additionalInfo %}
  48.                             <div class="dkc-location-detail__section-divider">
  49.                                 <div class="dkc-location-detail__section-content">{{ location.additionalInfo|raw }}</div>
  50.                             </div>
  51.                         {% endif %}
  52.                     </div>
  53.                 </div>
  54.                 {# Right: Map #}
  55.                 <div class="col-12 col-md-7 col-lg-8 dkc-location-detail__map-col">
  56.                     {% if location.latitude and location.longitude %}
  57.                         {% set mapData = [{
  58.                             "lat": location.latitude,
  59.                             "lng": location.longitude,
  60.                             "name": location.name,
  61.                             "company": location.company|default(''),
  62.                             "street": location.street,
  63.                             "zipcode": location.zipcode,
  64.                             "city": location.city,
  65.                             "country": location.country ? (location.country.translated.name|default(location.country.name|default(''))) : '',
  66.                             "url": ""
  67.                         }] %}
  68.                         <div class="dkc-location-detail__map"
  69.                              data-dkc-locations-map="true"
  70.                              data-locations='{{ mapData|json_encode|e("html_attr") }}'>
  71.                         </div>
  72.                     {% endif %}
  73.                 </div>
  74.             </div>
  75.             {# Employees #}
  76.             {% if groupedEmployees|length > 0 %}
  77.                 <div style="margin-top: 3rem;">
  78.                     <h2 class="dkc-employees__title">Unser Team</h2>
  79.                     {% for group in groupedEmployees %}
  80.                         <div class="dkc-department-group">
  81.                             <p class="dkc-department-group__label">{{ group.name }}</p>
  82.                             <div class="row">
  83.                                 {% for employee in group.employees %}
  84.                                     <div class="col-12 col-sm-6 col-lg-4 mb-4">
  85.                                         <div class="dkc-employee-card">
  86.                                             {% if employee.image %}
  87.                                                 <div class="dkc-employee-card__image-wrap">
  88.                                                     <img src="{{ employee.image.url }}"
  89.                                                          alt="{{ employee.firstName }} {{ employee.lastName }}"
  90.                                                          loading="lazy">
  91.                                                 </div>
  92.                                             {% endif %}
  93.                                             <div class="dkc-employee-card__body">
  94.                                                 <h5 class="dkc-employee-card__name">
  95.                                                     {{ employee.firstName }} {{ employee.lastName }}
  96.                                                 </h5>
  97.                                                 {% if employee.employeeDepartments and employee.employeeDepartments|length > 0 %}
  98.                                                     <p class="dkc-employee-card__department">
  99.                                                         {{ employee.employeeDepartments|map(ed => ed.department.name)|filter(n => n)|join(', ') }}
  100.                                                     </p>
  101.                                                 {% endif %}
  102.                                                 <div class="dkc-employee-card__contact">
  103.                                                     {% if employee.phone %}
  104.                                                         <p><strong>Tel:</strong> <a href="tel:{{ employee.phone }}">{{ employee.phone }}</a></p>
  105.                                                     {% endif %}
  106.                                                     {% if employee.email %}
  107.                                                         <p><strong>E-Mail:</strong> <a href="mailto:{{ employee.email }}">{{ employee.email }}</a></p>
  108.                                                     {% endif %}
  109.                                                 </div>
  110.                                             </div>
  111.                                         </div>
  112.                                     </div>
  113.                                 {% endfor %}
  114.                             </div>
  115.                         </div>
  116.                     {% endfor %}
  117.                 </div>
  118.             {% endif %}
  119.         </div>
  120.     </div>
  121. {% endblock %}