templates/_parts/realty/_layout-tabs-block.html.twig line 1

Open in your IDE?
  1. {% set class = class|default('') %}
  2. {% set imageObject = imageObject|default(null) %}
  3. {% set tabs = tabs|default([]) %}
  4. {% set floorGroupPlace = floorGroupPlace|default(null) %}
  5. <div class="layout-tabs-block {{ class }}">
  6.     <div class="layout-tabs-block__tabs tabs tabs__minor">
  7.         <ul class="layout-tabs-block__tabs-list smart-tabs tabs__list" data-smart-tabs>
  8.             {% for tab in tabs %}
  9.                 {% if tab['key'] == 'flat' %}
  10.                     {% if imageObject is has_image(tab.imageFieldName) %}
  11.                         <li class="layout-tabs-block__tab smart-tab tabs__item {% if loop.first %}_active{% endif %}">
  12.                             <a href="#layout-modal-tab-{{ loop.index }}"
  13.                                class="layout-tabs-block__link tabs__link"
  14.                                data-tab-link
  15.                             >
  16.                                 <span class="layout-tabs-block__link-title tabs__text text__small">
  17.                                     {{ tab.name }}
  18.                                 </span>
  19.                             </a>
  20.                         </li>
  21.                     {% endif %}
  22.                 {% endif %}
  23.             {% endfor %}
  24.             {% if floorGroupPlace %}
  25.                 <li class="layout-tabs-block__tab smart-tab tabs__item {% if not tabs|length %}_active{% endif %}">
  26.                     <a href="#layout-modal-tab-plan"
  27.                        class="layout-tabs-block__link tabs__link"
  28.                        data-tab-link
  29.                     >
  30.                         <span class="layout-tabs-block__link-title tabs__text text__small">
  31.                             План этажа
  32.                         </span>
  33.                     </a>
  34.                 </li>
  35.             {% endif %}
  36.             {% for tab in tabs %}
  37.                 {% if tab['key'] == 'furniture' %}
  38.                     {% if imageObject is has_image(tab.imageFieldName) %}
  39.                         <li class="layout-tabs-block__tab smart-tab tabs__item
  40.                                    {% if loop.first and not floorGroupPlace %}_active{% endif %}"
  41.                         >
  42.                             <a href="#layout-modal-tab-{{ loop.index }}"
  43.                                class="layout-tabs-block__link tabs__link"
  44.                                data-tab-link
  45.                             >
  46.                                 <span class="layout-tabs-block__link-title tabs__text text__small">
  47.                                     {{ tab.name }}
  48.                                 </span>
  49.                             </a>
  50.                         </li>
  51.                     {% endif %}
  52.                 {% endif %}
  53.             {% endfor %}
  54.         </ul>
  55.     </div>
  56.     <div class="layout-tabs-block__contents">
  57.         {% for tab in tabs %}
  58.             {% if tab['key'] == 'flat' %}
  59.                 <div id="layout-modal-tab-{{ loop.index }}"
  60.                     class="layout-tabs-block__content smart-content {% if loop.first %}_active{% endif %}"
  61.                     data-smart-content
  62.                 >
  63.                     {% if imageObject is has_image(tab.imageFieldName) %}
  64.                         {% include '_parts/image/adaptive-image.html.twig' with {
  65.                             object: imageObject,
  66.                             field: tab.imageFieldFile,
  67.                             size: 'layout_modal_image',
  68.                             alt: tab.name,
  69.                             class: 'layout-tabs-block__image',
  70.                             classPicture: 'layout-tabs-block__picture',
  71.                         } %}
  72.                     {% endif %}
  73.                 </div>
  74.             {% endif %}
  75.         {% endfor %}
  76.         {% if floorGroupPlace %}
  77.             <div id="layout-modal-tab-plan"
  78.                  class="layout-tabs-block__content smart-content {% if not tabs|length %}_active{% endif %}"
  79.                  data-smart-content
  80.             >
  81.                 {% include '_parts/genplan/_on-plan-genplan.html.twig' with {
  82.                     class: 'layout-tabs-block__genplan',
  83.                     floorGroupPlace: floorGroupPlace,
  84.                     disableOnReady: true
  85.                 } %}
  86.             </div>
  87.         {% endif %}
  88.         {% for tab in tabs %}
  89.             {% if tab['key'] == 'furniture' %}
  90.                 <div id="layout-modal-tab-{{ loop.index }}"
  91.                      class="layout-tabs-block__content smart-content
  92.                             {% if loop.first and not floorGroupPlace %}_active{% endif %}"
  93.                      data-smart-content
  94.                 >
  95.                     {% if imageObject is has_image(tab.imageFieldName) %}
  96.                         {% include '_parts/image/adaptive-image.html.twig' with {
  97.                             object: imageObject,
  98.                             field: tab.imageFieldFile,
  99.                             size: 'layout_modal_image',
  100.                             alt: tab.name,
  101.                             class: 'layout-tabs-block__image',
  102.                             classPicture: 'layout-tabs-block__picture',
  103.                         } %}
  104.                     {% endif %}
  105.                 </div>
  106.             {% endif %}
  107.         {% endfor %}
  108.     </div>
  109. </div>