{% extends 'web/base.html.twig' %}
{% block title %}{{ 'header.menu.topAction'| trans }}{% endblock %}
{% block keywords %}{{ 'topAkce.keywords' | trans }}{% endblock %}
{% block description %}{{ 'topAkce.metaDescription' | trans }}{% endblock %}
{% trans_default_domain 'web' %}
{% block javascripts %}
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js"></script>
<script>
$(document).ready(function () {
let $grid = $('.qodef-pl-inner').isotope({
itemSelector: '.qodef-pl-item',
layoutMode: 'fitRows'
});
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
let regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
let results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
let filterParam = getUrlParameter('filter');
if (filterParam) {
$('#filter-category').val(filterParam);
$grid.isotope({ filter: filterParam });
}
$('body').on('change', '#filter-shop', function () {
$('.qodef-pl-filter').removeClass('active');
let storeVal = $(this).val();
if (storeVal === "0") {
$grid.isotope({ filter: '*' });
} else {
$grid.isotope({ filter: '.store_' + storeVal });
}
history.pushState(null, null, window.location.pathname);
});
$('body').on('change', '#filter-category', function () {
let catVal = $(this).val();
$grid.isotope({ filter: catVal });
let newUrl = window.location.pathname + '?filter=' + encodeURIComponent(catVal);
history.pushState(null, null, newUrl);
});
});
</script>
{% endblock %}
{% block body %}
{{ include('web/core/header.html.twig') }}
<div class="qodef-content">
<div class="qodef-content-inner">
<div class="qodef-full-width">
<div class="qodef-full-width-inner">
<div class="qodef-grid-row">
<div class="qodef-page-content-holder qodef-grid-col-12">
<div class="qodef-row-grid-section-wrapper ">
<div class="qodef-row-grid-section">
<div class="vc_row wpb_row vc_row-fluid vc_custom_1567069896783">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="vc_column-inner">
<div class="wpb_wrapper">
<div class="qodef-title-holder qodef-breadcrumbs-type qodef-title-full-width qodef-title-va-header-bottom breadcrumb">
<div itemprop="breadcrumb" class="qodef-breadcrumbs">
<a itemprop="url" href="{{ path('app_web_homepage') }}">Home</a>
<span class="qodef-delimiter"> /  </span>
<a itemprop="url" href="{{ path('app_web_top-actions') }}">{{ 'header.menu.topAction'|trans }}</a>
</div>
<div class="qodef-section-title-holder" style="text-align: center; padding-bottom: 50px !important;">
<div class="qodef-st-inner">
<h1 class="qodef-st-title">{{ 'header.menu.topAction'|trans }}</h1>
</div>
</div>
</div>
<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">
<div class="select-wrapper">
<div class="select-store">
<select id="filter-category">
<option value="*">{{ 'allCategory'|trans }}</option>
{% for cat in categories %}
<option value=".category_{{ cat.id }}">{{ cat.getName() }}</option>
{% endfor %}
</select>
</div>
<div class="select-store">
<select id="filter-shop">
<option selected value="0">{{ 'selectStore' | trans }}</option>
{% for s in stores %}
<option value="{{ s.id }}">{{ s.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="qodef-pl-inner qodef-outer-space clearfix top-action">
{% if offers | length > 0 %}
{% for o in offers %}
<article
class="qodef-pl-item qodef-item-space portfolio-item type-portfolio-item top-action-detail category_{{ o.topCategory.id }} store_{{ o.store.id }}">
<a href="{{ path('app_web_shop_detail',{'slug':o.store.slug}) }}" class="qodef-pl-item-inner">
<div class="top-action-detail__image"
{% if o.image is not null %}
style="background-image: url({{ vich_uploader_asset(o, 'imageFile')| imagine_filter('news') }});"
{% elseif o.store.offerImage is not null %}
style="background-image: url({{ vich_uploader_asset(o.store, 'offerImageFile')| imagine_filter('news') }});"
{% elseif o.topCategory.image is not null %}
style="background-image: url({{ vich_uploader_asset(o.topCategory, 'imageFile')| imagine_filter('news') }});"
{% endif %}>
<div class="top-action-detail__image-logo">
{% if o.store.logo is not null %}
<img src="{{ vich_uploader_asset(o.store, 'logoFile')| imagine_filter('thumb300') }}" alt="{{ o.store.name }}">
{% endif %}
</div>
</div>
<div class="top-action-detail__content">
<h2 class="top-action-detail__title">
{{ o.getName }}
</h2>
{% if o.fromOutletPrice %}
<p class="top-action-detail__text">{{ 'topAkce.fromOutletPrice'|trans }}</p>
{% elseif o.fromNormalPrice %}
<p class="top-action-detail__text">{{ 'topAkce.fromNormalPrice'|trans }}</p>
{% endif %}
<h4 class="top-action-detail__subtitle">
{{ o.getTitle }}
</h4>
<p class="top-action-detail__text">
{{ o.getSubTitle }}
</p>
<p class="top-action-detail__date">
{{ o.dateFrom|date('d.m.Y') }} - {{ o.dateTo|date('d.m.Y') }}
</p>
</div>
</a>
</article>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{ include('web/core/gift-card.html.twig') }}
</div>
</div>
{{ include('web/core/footer.html.twig') }}
{% endblock %}