{% set header_background = file(setting_value('visiosoft.theme.restate::home_background_image')).make.url ?? img('visiosoft.theme.restate::images/6_1550_gv.jpg').url %}
{% include 'visiosoft.theme.restate::partials/introSearch' %}
{{ trans('visiosoft.theme.restate::field.popular') }}: {% for city_id in setting_value('visiosoft.theme.restate::popular_cities') %} {% set city = entries('location','cities').find(city_id) %} {{ city.name }} , {% endfor %} {{ trans('visiosoft.theme.restate::field.all_cities') }}
{% include "visiosoft.theme.restate::partials/headerDropdown" %} {{ trans("visiosoft.theme.restate::button.free_post_ad.name") }}
{{ trans('visiosoft.theme.restate::field.swipe_to_browse')|raw }}
{% if auth_user().file.first.make.url %}
{% else %} {{ img('visiosoft.theme.restate::images/user-circle.svg').width(46)|raw }} {% endif %}
{{ trans('visiosoft.theme.restate::field.my_account') }} {% if auth_check() %} {{ auth_user().name }} {{ trans('visiosoft.theme.restate::field.logout') }} {% else %} {{ trans('visiosoft.theme.restate::field.login') }} {{ trans('visiosoft.theme.restate::field.or') }} {{ trans('visiosoft.theme.restate::field.register') }} {% endif %}
{# {{ addBlock('navigation/navigation' , {}, ['favs'])|raw }}#}
{{ trans("visiosoft.theme.restate::button.free_post_ad.name") }}
{% if setting_value('visiosoft.theme.restate::footer_logo') %} {{ img(file(setting_value('visiosoft.theme.restate::footer_logo')).make.url).class('d-block')|raw }} {% else %} {{ img('visiosoft.theme.restate::images/logo-white.png')|raw }} {% endif %}
{% set categories = entries('cats','category').getMainCategories() %} {% for category in categories|slice(0,3) %}
{{ img(url(category.icon)).width(32)|raw }} {{ category.name }}
{{ img('visiosoft.theme.restate::images/arrow-right.svg').data|raw }}
{% endfor %} {% if categories|length > 3 %}
{{ trans('visiosoft.theme.restate::field.show_all') }}
{{ img('visiosoft.theme.restate::images/arrow-right.svg').data|raw }}
{% endif %}
{% set categories = entries('cats','category').getMainAndSubCats() %}
{% for mainCat in categories.maincats %}

{{ mainCat.name }}


{% for subCat in categories.subcats.where('id', mainCat.id)|slice(0, 4) %} {{ subCat.c2_name }} {{ subCat.c2_count }} {% endfor %}
{% endfor %}
{% if setting_value('visiosoft.theme.restate::homepage_cats_with_images') %}
{% for mainCat in categories.maincats %} {% set topFilter = getCustomFieldById(setting_value('visiosoft.theme.restate::list_top_customfield')) %}
{% set img = mainCat.image_id ? file(mainCat.image_id).make.url : img('visiosoft.theme.restate::images/pexels-negative-space-169573.jpg').url %}
{{ mainCat.name }}
{% if topFilter.values is not empty %}
{% for key, val in topFilter.values[:3] %} {{ val.custom_field_value }} {% endfor %}
{% for key, val in topFilter.values[3:] %} {{ val.custom_field_value }} {% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{{ setting_value('visiosoft.theme.restate::homepage_banner_section')|raw }}
{% include "visiosoft.theme.restate::index/partials/latest_ads" %}
{{ trans('visiosoft.theme.restate::field.popular_cities') }}
{# {{ addBlock('index-top')|raw }}#}
{% include "visiosoft.theme.restate::index.partials.recommended_ads" %}
{% include "visiosoft.theme.restate::index/partials/articles" %}
{% for link in links %}

{% set sublinks = entries('navigation', 'links').where('parent_id', link.id).get() %} {% for sublink in sublinks %} {% endfor %}
{% endfor %}
{% include "visiosoft.theme.restate::partials.footer" %} {# {{ addBlock('autocomplete')|raw }}#}