templates/_parts/infrastructure/_infrastructure-list.html.twig line 1

Open in your IDE?
  1. {% set walkCount = false %}
  2. {% set busCount = false %}
  3. {% for infrastructureItem in infrastructureItems %}
  4.     {% if infrastructureItem.wayType == 10 %}
  5.         {% set walkCount = true %}
  6.     {% endif %}
  7.     {% if infrastructureItem.wayType == 20 %}
  8.         {% set busCount = true %}
  9.     {% endif %}
  10. {% endfor %}
  11. {% if walkCount %}
  12.     <div class="infrastructure__infrastructure-wrap infrastructure__infrastructure-wrap_walk">
  13.         <div class="infrastructure__title-wrap">
  14.             <div class="infrastructure__icon-wrap">
  15.                 {% include '_parts/icons/man-icon.svg' %}
  16.             </div>
  17.             <div class="infrastructure__text text__main text__black-text">
  18.                 Пешком
  19.             </div>
  20.         </div>
  21.         <ul class="infrastructure__places">
  22.             {% for infrastructureItem in infrastructureItems %}
  23.                 {% if infrastructureItem.wayType == 10 %}
  24.                     <li class="infrastructure__place">
  25.                         <div class="infrastructure__place-name text__body text__black-text">
  26.                             {{ infrastructureItem.name }}
  27.                         </div>
  28.                         <span class="infrastructure__dots"></span>
  29.                         <div class="infrastructure__distance-time-wrap text__body text__main01">
  30.                             {{ infrastructureItem.distance }}
  31.                             /
  32.                             {{ infrastructureItem.time }}
  33.                         </div>
  34.                     </li>
  35.                 {% endif %}
  36.             {% endfor %}
  37.         </ul>
  38.     </div>
  39. {% endif %}
  40. {% if busCount %}
  41.     <div class="infrastructure__infrastructure-wrap infrastructure__infrastructure-wrap_bus">
  42.         <div class="infrastructure__title-wrap">
  43.             <div class="infrastructure__icon-wrap">
  44.                 {% include '_parts/icons/bus-icon.svg' %}
  45.             </div>
  46.             <div class="infrastructure__text text__main text__black-text">
  47.                 На общественном транспорте
  48.             </div>
  49.         </div>
  50.         <ul class="infrastructure__places">
  51.             {% for infrastructureItem in infrastructureItems %}
  52.                 {% if infrastructureItem.wayType == 20 %}
  53.                     <li class="infrastructure__place">
  54.                         <div class="infrastructure__place-name text__body text__black-text">
  55.                             {{ infrastructureItem.name }}
  56.                         </div>
  57.                         <span class="infrastructure__dots"></span>
  58.                         <div class="infrastructure__distance-time-wrap text__body text__main01">
  59.                             {{ infrastructureItem.distance }}
  60.                             /
  61.                             {{ infrastructureItem.time }}
  62.                         </div>
  63.                     </li>
  64.                 {% endif %}
  65.             {% endfor %}
  66.         </ul>
  67.     </div>
  68. {% endif %}