templates/web/default/top-actions.html.twig line 157

Open in your IDE?
  1. {% extends 'web/base.html.twig' %}
  2. {% block title %}{{ 'header.menu.topAction'| trans }}{% endblock %}
  3. {% block keywords %}{{ 'topAkce.keywords' | trans }}{% endblock %}
  4. {% block description %}{{ 'topAkce.metaDescription' | trans }}{% endblock %}
  5. {% trans_default_domain 'web' %}
  6. {% block javascripts %}
  7. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  8. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js"></script>
  9. <script>
  10. $(document).ready(function () {
  11. let $grid = $('.qodef-pl-inner').isotope({
  12. itemSelector: '.qodef-pl-item',
  13. layoutMode: 'fitRows'
  14. });
  15. function getUrlParameter(name) {
  16. name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  17. let regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
  18. let results = regex.exec(location.search);
  19. return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
  20. }
  21. let filterParam = getUrlParameter('filter');
  22. if (filterParam) {
  23. $('#filter-category').val(filterParam);
  24. $grid.isotope({ filter: filterParam });
  25. }
  26. $('body').on('change', '#filter-shop', function () {
  27. $('.qodef-pl-filter').removeClass('active');
  28. let storeVal = $(this).val();
  29. if (storeVal === "0") {
  30. $grid.isotope({ filter: '*' });
  31. } else {
  32. $grid.isotope({ filter: '.store_' + storeVal });
  33. }
  34. history.pushState(null, null, window.location.pathname);
  35. });
  36. $('body').on('change', '#filter-category', function () {
  37. let catVal = $(this).val();
  38. $grid.isotope({ filter: catVal });
  39. let newUrl = window.location.pathname + '?filter=' + encodeURIComponent(catVal);
  40. history.pushState(null, null, newUrl);
  41. });
  42. });
  43. </script>
  44. {% endblock %}
  45. {% block body %}
  46. {{ include('web/core/header.html.twig') }}
  47. <div class="qodef-content">
  48. <div class="qodef-content-inner">
  49. <div class="qodef-full-width">
  50. <div class="qodef-full-width-inner">
  51. <div class="qodef-grid-row">
  52. <div class="qodef-page-content-holder qodef-grid-col-12">
  53. <div class="qodef-row-grid-section-wrapper ">
  54. <div class="qodef-row-grid-section">
  55. <div class="vc_row wpb_row vc_row-fluid vc_custom_1567069896783">
  56. <div class="wpb_column vc_column_container vc_col-sm-12">
  57. <div class="vc_column-inner">
  58. <div class="wpb_wrapper">
  59. <div class="qodef-title-holder qodef-breadcrumbs-type qodef-title-full-width qodef-title-va-header-bottom breadcrumb">
  60. <div itemprop="breadcrumb" class="qodef-breadcrumbs">
  61. <a itemprop="url" href="{{ path('app_web_homepage') }}">Home</a>
  62. <span class="qodef-delimiter">&nbsp; / &nbsp</span>
  63. <a itemprop="url" href="{{ path('app_web_top-actions') }}">{{ 'header.menu.topAction'|trans }}</a>
  64. </div>
  65. <div class="qodef-section-title-holder" style="text-align: center; padding-bottom: 50px !important;">
  66. <div class="qodef-st-inner">
  67. <h1 class="qodef-st-title">{{ 'header.menu.topAction'|trans }}</h1>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="qodef-portfolio-list-holder qodef-grid-list qodef-pl-gallery qodef-four-columns qodef-medium-space qodef-pl-gallery-overlay qodef-pl-pag-load-more qodef-pl-has-filter">
  72. <div class="select-wrapper">
  73. <div class="select-store">
  74. <select id="filter-category">
  75. <option value="*">{{ 'allCategory'|trans }}</option>
  76. {% for cat in categories %}
  77. <option value=".category_{{ cat.id }}">{{ cat.getName() }}</option>
  78. {% endfor %}
  79. </select>
  80. </div>
  81. <div class="select-store">
  82. <select id="filter-shop">
  83. <option selected value="0">{{ 'selectStore' | trans }}</option>
  84. {% for s in stores %}
  85. <option value="{{ s.id }}">{{ s.name }}</option>
  86. {% endfor %}
  87. </select>
  88. </div>
  89. </div>
  90. <div class="qodef-pl-inner qodef-outer-space clearfix top-action">
  91. {% if offers | length > 0 %}
  92. {% for o in offers %}
  93. <article
  94. class="qodef-pl-item qodef-item-space portfolio-item type-portfolio-item top-action-detail category_{{ o.topCategory.id }} store_{{ o.store.id }}">
  95. <a href="{{ path('app_web_shop_detail',{'slug':o.store.slug}) }}" class="qodef-pl-item-inner">
  96. <div class="top-action-detail__image"
  97. {% if o.image is not null %}
  98. style="background-image: url({{ vich_uploader_asset(o, 'imageFile')| imagine_filter('news') }});"
  99. {% elseif o.store.offerImage is not null %}
  100. style="background-image: url({{ vich_uploader_asset(o.store, 'offerImageFile')| imagine_filter('news') }});"
  101. {% elseif o.topCategory.image is not null %}
  102. style="background-image: url({{ vich_uploader_asset(o.topCategory, 'imageFile')| imagine_filter('news') }});"
  103. {% endif %}>
  104. <div class="top-action-detail__image-logo">
  105. {% if o.store.logo is not null %}
  106. <img src="{{ vich_uploader_asset(o.store, 'logoFile')| imagine_filter('thumb300') }}" alt="{{ o.store.name }}">
  107. {% endif %}
  108. </div>
  109. </div>
  110. <div class="top-action-detail__content">
  111. <h2 class="top-action-detail__title">
  112. {{ o.getName }}
  113. </h2>
  114. {% if o.fromOutletPrice %}
  115. <p class="top-action-detail__text">{{ 'topAkce.fromOutletPrice'|trans }}</p>
  116. {% elseif o.fromNormalPrice %}
  117. <p class="top-action-detail__text">{{ 'topAkce.fromNormalPrice'|trans }}</p>
  118. {% endif %}
  119. <h4 class="top-action-detail__subtitle">
  120. {{ o.getTitle }}
  121. </h4>
  122. <p class="top-action-detail__text">
  123. {{ o.getSubTitle }}
  124. </p>
  125. <p class="top-action-detail__date">
  126. {{ o.dateFrom|date('d.m.Y') }} - {{ o.dateTo|date('d.m.Y') }}
  127. </p>
  128. </div>
  129. </a>
  130. </article>
  131. {% endfor %}
  132. {% endif %}
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. {{ include('web/core/gift-card.html.twig') }}
  146. </div>
  147. </div>
  148. {{ include('web/core/footer.html.twig') }}
  149. {% endblock %}