templates/areas/locations/view.html.twig line 1

Open in your IDE?
  1. <div class="locations standard-component mb-3 mb-md-7">
  2.     {% set dayOfWeek = 'now'|date('N') %}
  3.     {% set locations = [] %}
  4.     {% for location in locationList %}
  5.         {% set locations = locations|merge([
  6.             {
  7.                 name: location.name,
  8.                 tel: location.phone,
  9.                 telSale: location.phoneSale,
  10.                 telService: location.phoneService,
  11.                 telParts: location.phoneParts,
  12.                 image: location.image,
  13.                 address: {
  14.                 street: {
  15.                     name: location.street,
  16.                 },
  17.                 city: {
  18.                     name: location.city,
  19.                     zip: location.zip
  20.                 }
  21.             },
  22.                 links: {
  23.                 team: location.teamLink,
  24.                 cars: location.carsLink,
  25.                 appointment: location.appointmentLink,
  26.                 service: location.serviceLink
  27.             },
  28.                 times: {
  29.                 sale: {
  30.                     list: location.businessHoursSale
  31.                 },
  32.                 service: {
  33.                     list: location.businessHoursService
  34.                 },
  35.                 parts: {
  36.                     list: location.businessHoursParts
  37.                 }
  38.             }
  39.             },
  40.         ]) %}
  41.     {% endfor %}
  42.     {% for location in locations %}
  43.         <input class="d-none" type="radio" name="location-select" id="location-{{ loop.index }}" value="{{ location.name }}" {% if loop.index == 1 %}checked{% endif %}>
  44.     {% endfor %}
  45.     <nav class="locations-nav" aria-label="Stardort Navigation">
  46.         <ul>
  47.             {% for location in locations %}
  48.                 <li><label for="location-{{ loop.index }}">{{ location.name }}</label></li>
  49.             {% endfor %}
  50.         </ul>
  51.     </nav>
  52.     <div class="locations-content-holder">
  53.         {% for location in locations %}
  54.             {% set telURL = location.tel|replace({' ': '', '/': '', '-': ''})|slice(1) %}
  55.             {% set telURLSale = location.telSale|replace({' ': '', '/': '', '-': ''})|slice(1) %}
  56.             {% set telURLService = location.telService|replace({' ': '', '/': '', '-': ''})|slice(1) %}
  57.             {% set telURLParts = location.telParts|replace({' ': '', '/': '', '-': ''})|slice(1) %}
  58.             <div class="locations-content" id="locations-content-{{ loop.index }}">
  59.                 <div class="row align-items-center border-md-1 border-bmw-light-60 p-md-4 mx-0 mb-4">
  60.                     <div class="col-md-4 text-bmw-dark-80 mb-5 mb-md-0">
  61.                         <h4>Anfahrt &amp; Kontakt</h4>
  62.                         <p class="icon-map">
  63.                             {{ location.address.street.name }}
  64.                             <br>
  65.                             {{ location.address.city.zip }}
  66.                             {{ location.address.city.name }}
  67.                         </p>
  68.                         <p class="icon-tel">
  69.                             <a href="tel:+49{{ telURL }}">{{ location.tel }}</a>
  70.                         </p>
  71.                         <p class="icon-none fw-bold m-0">
  72.                             <a href="{{ location.links.team }}">Unser Team</a>
  73.                         </p>
  74.                     </div>
  75.                     <div class="col-md-8 px-0 px-md-2">
  76.                         <div class="px-md-1">
  77.                             <img src="{{ location.image }}" alt="Standort {{ location.name }}"/>
  78.                         </div>
  79.                     </div>
  80.                 </div>
  81.                 <div class="row text-bmw-dark-80 py-4 px-2 p-md-4 mx-0">
  82.                     <div class="col-12 mb-3 mb-md-0">
  83.                         <h4>Öffnungszeiten &amp; Kontakt</h4>
  84.                     </div>
  85.                     <div class="col-md-4 col-lg-3 mb-3 mb-md-0 small">
  86.                         <p class="text-capitalize fw-bold mb-2">Verkauf</p>
  87.                         <dl>
  88.                             {%  for data in location.times.sale.list %}
  89.                                 <dt {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.day }}</dt>
  90.                                 <dd {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.hour }}</dd>
  91.                             {% endfor %}
  92.                             <dt class="icon-tel">Telefon</dt>
  93.                             <dd><a href="tel:+49{{ telURLSale }}">{{ location.telSale }}</a></dd>
  94.                         </dl>
  95.                     </div>
  96.                     <div class="col-md-4 col-lg-3 mb-3 mb-md-0 small">
  97.                         <p class="text-capitalize fw-bold mb-2">Service</p>
  98.                         <dl>
  99.                             {%  for data in location.times.service.list %}
  100.                                 <dt {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.day }}</dt>
  101.                                 <dd {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.hour }}</dd>
  102.                             {% endfor %}
  103.                             <dt class="icon-tel">Telefon</dt>
  104.                             <dd><a href="tel:+49{{ telURLService }}">{{ location.telService }}</a></dd>
  105.                         </dl>
  106.                     </div>
  107.                     <div class="col-md-4 col-lg-3 mb-3 mb-md-0 small">
  108.                         <p class="text-capitalize fw-bold mb-2">Teile &amp; Zubehör</p>
  109.                         <dl>
  110.                             {%  for data in location.times.parts.list %}
  111.                                 <dt {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.day }}</dt>
  112.                                 <dd {% if dayOfWeek in data.dayOfWeekHighlight   %}class="fw-bold text-bmw-blue"{% endif %}>{{ data.hour }}</dd>
  113.                             {% endfor %}
  114.                             <dt class="icon-tel">Telefon</dt>
  115.                             <dd><a href="tel:+49{{ telURLParts }}">{{ location.telParts }}</a></dd>
  116.                         </dl>
  117.                     </div>
  118.                     <div class="col-md-5 col-lg-3 mx-auto">
  119.                         <p><a href="{{ location.links.cars }}" class="btn btn-primary w-100">Unsere Fahrzeuge</a></p>
  120.                         <p><a href="{{ location.links.appointment }}" class="btn btn-primary w-100">Beratungstermin</a></p>
  121.                         <p><a href="{{ location.links.service }}" class="btn btn-primary w-100">Service Termin</a></p>
  122.                     </div>
  123.                 </div>
  124.             </div>
  125.         {% endfor %}
  126.     </div>
  127. </div>