{% extends "base.html" %} {% block title %}{{ t('inventory_browse_title', lang) }} | {{ settings.company_name }}{% endblock %} {% block content %} {% set body_styles = ['Sedan', 'SUV', 'Truck', 'Coupe', 'Hatchback', 'Van', 'Convertible'] %} {% set transmissions = [('', t('any', lang)), ('Automatic', t('automatic', lang)), ('Manual', t('manual', lang)), ('CVT', 'CVT')] %} {% set fuel_types = ['Gasoline', 'Diesel', 'Hybrid', 'Electric'] %} {% set drivetrains = ['FWD', 'RWD', 'AWD', '4WD'] %} {% set sort_options = [ ('price_low', t('price_low_high', lang)), ('price_high', t('price_high_low', lang)), ('year_newest', t('year_newest', lang)), ('odometer', t('odometer_lowest', lang)), ('newest', t('newest_listed', lang)), ] %} {# ── remove_param is provided by the app context processor ── #} {# ── active filter chip helper ── #} {% macro filter_chip(label, param) %} {{ label }} × {% endmacro %} {# ── build list of active filter chips ── #} {% set chips = [] %} {% if request.args.get('q') %} {{ chips.append(filter_chip(t('search', lang) ~ ': ' ~ request.args.get('q'), 'q')) or '' }} {% endif %} {% if request.args.get('make') %} {{ chips.append(filter_chip(request.args.get('make'), 'make')) or '' }} {% endif %} {% if request.args.get('body_style') %} {{ chips.append(filter_chip(t('body_style_' ~ request.args.get('body_style')|lower|replace(' ', '_'), lang) or request.args.get('body_style'), 'body_style')) or '' }} {% endif %} {% if request.args.get('transmission') %} {{ chips.append(filter_chip(request.args.get('transmission'), 'transmission')) or '' }} {% endif %} {% if request.args.get('fuel_type') %} {{ chips.append(filter_chip(request.args.get('fuel_type'), 'fuel_type')) or '' }} {% endif %} {% if request.args.get('drive_line') %} {{ chips.append(filter_chip(request.args.get('drive_line'), 'drive_line')) or '' }} {% endif %} {% if request.args.get('year_from') %} {{ chips.append(filter_chip(t('year_from', lang) ~ ': ' ~ request.args.get('year_from'), 'year_from')) or '' }} {% endif %} {% if request.args.get('year_to') %} {{ chips.append(filter_chip(t('year_to', lang) ~ ': ' ~ request.args.get('year_to'), 'year_to')) or '' }} {% endif %} {% if request.args.get('price_min') %} {{ chips.append(filter_chip(t('min_price', lang) ~ ': $' ~ request.args.get('price_min'), 'price_min')) or '' }} {% endif %} {% if request.args.get('price_max') %} {{ chips.append(filter_chip(t('max_price', lang) ~ ': $' ~ request.args.get('price_max'), 'price_max')) or '' }} {% endif %} {% if request.args.get('odometer_min') %} {{ chips.append(filter_chip(t('odometer_min', lang) ~ ': ' ~ request.args.get('odometer_min') ~ ' km', 'odometer_min')) or '' }} {% endif %} {% if request.args.get('odometer_max') %} {{ chips.append(filter_chip(t('odometer_max', lang) ~ ': ' ~ request.args.get('odometer_max') ~ ' km', 'odometer_max')) or '' }} {% endif %} {% if request.args.get('certified') %} {{ chips.append(filter_chip(t('certified_pre_owned', lang), 'certified')) or '' }} {% endif %} {% if request.args.get('sort') and request.args.get('sort') != 'newest' %} {% for val, label in sort_options %} {% if val == request.args.get('sort') %} {{ chips.append(filter_chip(label, 'sort')) or '' }} {% endif %} {% endfor %} {% endif %} {# ── page header ── #}

{{ t('used_cars_for_sale', lang) }}

{{ t('inventory_browse_subtitle', lang) }}

{# ── main layout: sidebar + content ── #}
{# ── mobile filter toggle ── #} {# ── filter sidebar ── #} {# ── main content area ── #}
{# ── top bar: result count + sort dropdown ── #}

{{ result_count or listings|length }} {{ t('vehicles_found', lang) }}

{{ t('pricing_disclaimer', lang) }}

{# ── active filter chips ── #} {% if chips|length > 0 %}
{{ t('active_filters', lang) }} {% for chip in chips %} {{ chip|safe }} {% endfor %} {{ t('clear_all', lang) }}
{% endif %} {# ── listing grid ── #} {% if listings|length > 0 %}
{% for listing in listings %} {% include "partials/listing_card.html" %} {% endfor %}
{% else %} {# ── empty state ── #}

{{ t('no_vehicles_found', lang) }}

{{ t('no_vehicles_suggestion', lang) }}

{{ t('clear_all_filters', lang) }}
{% endif %}
{% endblock %} {% block body_end %} {% endblock %}