{% if classifieds|length > 0 %}
{% set orderByOptions = { cena: { label: 'Cena' }, data_dodania: { label: 'Data dodania' }, } %} {% set sortBy = app.request.query.get('sortuj', 'data_dodania') %} {% set sortDirection = app.request.query.get('sortuj_kolejnosc', 'malejaco') %}
{{ 'Sortuj:' }} {% for key, option in orderByOptions %} {{ option.label }} {% endfor %}
{% for key,classified in classifieds %} {% set classes = ['classified_list_item'] %} {% set classifiedLink = path('classified', { 'section' : sections.current.locale.slug, 'slug': classified.locale.slug }) %} {% if classified.promoted and classified.isHighlightedLists %} {% set classes = classes|merge(['classified_list_item--promoted']) %} {% endif %}
{% if classified.images.count > 0 %} {% set image_src = vich_uploader_asset(classified.images.first, 'imageFile') %} {% else %} {% set image_src = null %} {% endif %} {{- app_macros.image( image_src, 'classified_profile_images', 'img-responsive classified_list_item', classified.locale.name ) -}}

{{- classified.locale.name -}}

{{- classified.createdDate.format('d-m-Y') -}}

{% if classified.voivodeship is not empty %} {{- classified.voivodeship.name -}} {% endif %} {% if classified.polishCity is not empty %} {{- classified.polishCity.name -}} {% endif %}
{{ macros.price_container(classified.price) }}
{{- classified.locale.content|striptags|truncate(170, true)|raw -}}
{% if app.user is not empty and classified.user is not empty and app.user.id == classified.user.id %} {{- 'Podbij' -}} {% endif %}
{% include '@Classifieds/blocks/classified_star.html.twig' %}
{% if key == 1 and app.request.get('_route') == 'classifieds_category' %} {{ ads_block_classifieds('ad', category) }} {% endif %} {% endfor %} {% if classifieds|length < 2 and app.request.get('_route') == 'classifieds_category' %} {{ ads_block_classifieds('ad', category) }} {% endif %} {% include '@Core/frontend/blocks/paginator_numbers.html.twig' with { route_params: app.request.query.all|merge({ section: app.request.attributes.get('section'), slug: app.request.attributes.get('slug'), category_slug: app.request.attributes.get('category_slug'), }) } %}
{% else %}
{% if company|default(false) is empty %} {{- 'Nie wiemy jak to możliwe, ale tu nie ma jeszcze żadnych ogłoszeń - zmienisz to?' -}} {% else %} {{- 'Firma ' ~ company.user.fullName ~ ' aktualnie nie posiada ogłoszeń w portalu.' -}} {% endif %}
{% endif %}