{# Homepage discovery sections (Phase 8 data, Phase 9 polish). Horizontal-scrolling rows of the shared listing card, a category tile row, and polished empty states. Ranking is done in the discovery service — the template only renders what it is given. Only the per-section badge / empty copy differs between rows. #} {% from "components/listing_card.html" import listing_card with context %} {# discovery_row: badge - a mk_badge kind overlaid on each card (trending/featured/new/popular…) empty_* - contextual empty state; when omitted, an empty section is skipped. #} {% macro discovery_row(title, icon, listings, view_all_url=None, premium_ids=None, badge=None, empty_icon='bi-compass', empty_text=None, cta_label=None, cta_url=None) %} {% if listings or empty_text %}

{{ title }}

{% if listings and view_all_url %} View all {% endif %}
{% if listings %}
{% for listing in listings %} {{ listing_card(listing, actions=['view_details'], show_status=false, meta=['condition'], favorite=true, premium_ids=premium_ids, section_badge=badge, reputations=(reputation_map if reputation_map is defined else none), badges=(badge_map if badge_map is defined else none)) }} {% endfor %}
{% else %}

{{ empty_text }}

{% if cta_label and cta_url %} {{ cta_label }} {% endif %}
{% endif %}
{% endif %} {% endmacro %} {% macro discovery_categories(title, icon, categories) %} {% if categories %}

{{ title }}

{% for item in categories %} {{ item.category.name }} {{ item.count }} listing{{ '' if item.count == 1 else 's' }} {% endfor %}
{% endif %} {% endmacro %}