templates/application/projects/item.html.twig line 1

Open in your IDE?
  1. {% extends 'application/layout.html.twig' %}
  2. {% block content %}
  3.     <main class="main">
  4.         <div class="breadcrumb">
  5.             <div class="container">
  6.                 <ol class="breadcrumb__list">
  7.                     <li class="breadcrumb__item"><a href="{{ path('home') }}" class="breadcrumb__link">Главная</a></li>
  8.                     <li class="breadcrumb__item"><a href="{{ path('gallery') }}" class="breadcrumb__link">Галерея проектов</a></li>
  9.                     <li class="breadcrumb__item active" aria-current="page">{{ item.name(app.request.locale) }}</li>
  10.                 </ol>
  11.             </div>
  12.         </div>
  13.         <div class="page page--project">
  14.             <div class="container">
  15.                 <div class="page__header">
  16.                     <h1 class="page__title">{{ item.name(app.request.locale) }}</h1>
  17.                 </div>
  18.                 <div class="project__row">
  19.                     <div class="project__main">
  20.                         <div class="project-promo swiper a-carousel-single nav-inside">
  21.                             <div class="swiper-wrapper">
  22.                                 {% for image in item.images %}
  23.                                     {% set imageNumber = loop.index %}
  24.                                     <div class="swiper-slide">
  25.                                         <div class="project-promo__photo">
  26.                                             {{ include('application/partial/picture.html.twig', {image: image, width: 929, height: 629}) }}
  27.                                         </div>
  28.                                         {% for projectProduct in item.products %}
  29.                                             {% if projectProduct.imageNumber == imageNumber %}
  30.                                                 <div class="project-promo__tooltip item-tooltip" style="left: {{ projectProduct.x / 9.3 }}%; top: {{ projectProduct.y / 6.3 }}%;">
  31.                                                     <div class="item-tooltip__toggle a-tooltip">
  32.                                                         <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 8a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H2a1 1 0 0 1-1-1z"/><path d="M8 1a1 1 0 0 1 1 1v12a1 1 0 1 1-2 0V2a1 1 0 0 1 1-1z"/></svg>
  33.                                                     </div>
  34.                                                     <div class="item-tooltip__menu">
  35.                                                         <button class="item-tooltip__close a-tooltip"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.146 3.146a.5.5 0 0 1 .708 0l9 9a.5.5 0 0 1-.708.708l-9-9a.5.5 0 0 1 0-.708z"></path><path d="M12.854 3.146a.5.5 0 0 0-.708 0l-9 9a.5.5 0 0 0 .708.708l9-9a.5.5 0 0 0 0-.708z"></path></svg></button>
  36.                                                         <div class="item-tooltip__photo">
  37.                                                             {{ include('application/partial/picture.html.twig', {image: projectProduct.product.image, width: 50, height: 50}) }}
  38.                                                         </div>
  39.                                                         <div class="item-tooltip__detail">
  40.                                                             <div class="item-tooltip__title"><a href="{{ documentUrl(projectProduct.product) }}">{{ projectProduct.product.name(app.request.locale) }}</a></div>
  41.                                                             <div class="item-tooltip__price"><span class="item-tooltip__value">{{ projectProduct.product.price|number_format(2, '.', ' ') }}</span> ₽ за шт.</div>
  42.                                                             <div class="item-tooltip__descr">{{ projectProduct.shortText }}</div>
  43.                                                         </div>
  44.                                                     </div>
  45.                                                 </div>
  46.                                             {% endif %}
  47.                                         {% endfor %}
  48.                                     </div>
  49.                                 {% endfor %}
  50.                             </div>
  51.                             <div class="btn-prev"><svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.854 12.867a.536.536 0 0 1-.708 0l-5-4.546a.426.426 0 0 1 0-.642l5-4.546a.536.536 0 0 1 .708 0 .426.426 0 0 1 0 .643L6.207 8l4.647 4.224a.426.426 0 0 1 0 .643z"/></svg></div>
  52.                             <div class="btn-next"><svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.146 3.133a.536.536 0 0 1 .708 0l5 4.546a.426.426 0 0 1 0 .642l-5 4.546a.536.536 0 0 1-.708 0 .426.426 0 0 1 0-.643L9.793 8 5.146 3.776a.426.426 0 0 1 0-.643z"/></svg></div>
  53.                         </div>
  54.                     </div>
  55.                     <div class="project__sidebar">
  56.                         <div class="box project__detail">
  57.                             <h3 class="project__title">Описание проекта</h3>
  58.                             <div class="project__descr">{{ item.shortText(app.request.locale)|raw }}</div>
  59.                             <div class="param-tbl">
  60.                                 {% for projectProduct in item.products %}
  61.                                     <div class="param-tbl__item">
  62.                                         <div class="param-tbl__param">{{ projectProduct.product.name(app.request.locale) }}</div>
  63.                                         <div class="param-tbl__value"><span class="price__value">{{ projectProduct.amount|number_format(2, '.', ' ') }}</span> <span class="price__unit">₽</span></div>
  64.                                     </div>
  65.                                 {% endfor %}
  66.                                 <div class="param-tbl__item project__price">
  67.                                     <div class="param-tbl__param">Итого</div>
  68.                                     <div class="param-tbl__value">
  69.                                         <span class="price__value">{{ item.amount|number_format(2, '.', ' ') }}</span>
  70.                                         <span class="price__unit">₽</span>
  71.                                     </div>
  72.                                 </div>
  73.                             </div>
  74.                         </div>
  75.                     </div>
  76.                 </div>
  77.             </div>
  78.         </div>
  79.         <div class="section">
  80.             <div class="container">
  81.                 <div class="section__item section__item--md">
  82.                     <h2 class="product-add__title">Товары из проекта</h2>
  83.                     <div class="product-carousel swiper a-carousel-product nav-right">
  84.                         <div class="swiper-wrapper">
  85.                             {% for projectProduct in item.products %}
  86.                                 {% if projectProduct.product.active %}
  87.                                     <div class="swiper-slide">
  88.                                         {{ include('application/catalog/product-block.html.twig', {product: projectProduct.product}) }}
  89.                                     </div>
  90.                                 {% endif %}
  91.                             {% endfor %}
  92.                         </div>
  93.                         <div class="btn-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.854 12.867a.536.536 0 0 1-.708 0l-5-4.546a.426.426 0 0 1 0-.642l5-4.546a.536.536 0 0 1 .708 0 .426.426 0 0 1 0 .643L6.207 8l4.647 4.224a.426.426 0 0 1 0 .643z"/></svg></div>
  94.                         <div class="btn-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.146 3.133a.536.536 0 0 1 .708 0l5 4.546a.426.426 0 0 1 0 .642l-5 4.546a.536.536 0 0 1-.708 0 .426.426 0 0 1 0-.643L9.793 8 5.146 3.776a.426.426 0 0 1 0-.643z"/></svg></div>
  95.                     </div>
  96.                 </div>
  97.                 {% if otherProject|length %}
  98.                     <div class="section__item section__item--md">
  99.                         <h2 class="product-add__title">Другие проекты</h2>
  100.                         <div class="project__carousel swiper a-carousel-projects-inside nav-right">
  101.                             <div class="swiper-wrapper">
  102.                                 {% for project in otherProject %}
  103.                                     <div class="swiper-slide {% if loop.index0 % 5 == 0 %}project__column--lg{% endif %}">
  104.                                         {{ include('application/projects/project-block.html.twig') }}
  105.                                     </div>
  106.                                 {% endfor %}
  107.                             </div>
  108.                             <div class="btn-prev"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.854 12.867a.536.536 0 0 1-.708 0l-5-4.546a.426.426 0 0 1 0-.642l5-4.546a.536.536 0 0 1 .708 0 .426.426 0 0 1 0 .643L6.207 8l4.647 4.224a.426.426 0 0 1 0 .643z"/></svg></div>
  109.                             <div class="btn-next"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.146 3.133a.536.536 0 0 1 .708 0l5 4.546a.426.426 0 0 1 0 .642l-5 4.546a.536.536 0 0 1-.708 0 .426.426 0 0 1 0-.643L9.793 8 5.146 3.776a.426.426 0 0 1 0-.643z"/></svg></div>
  110.                         </div>
  111.                     </div>
  112.                 {% endif %}
  113.             </div>
  114.         </div>
  115.     </main>
  116. {% endblock %}
  117. {% block scripts %}
  118. <script>
  119.     $('.a-tooltip').on('click', function() {
  120.         $(this).closest('.item-tooltip').toggleClass('active');
  121.         return false;
  122.     });
  123. </script>
  124. {% endblock %}