{# _macros/carousel.html ───────────────────── Provides two macros for image display: gallery(images, image_endpoint, title='', show_badges=true) Single-garment hero + thumbnail strip. images: list of dicts — {filename, front, back, model} image_endpoint: Flask endpoint name that accepts filename= e.g. 'wardrobe.image' title: alt text for the hero image show_badges: if true, show Front/Back/Model labels on thumbs carousel(images, image_endpoint) Multi-image horizontal scrolling strip with lightbox on click. images: list of filename strings (pre-ordered, pre-deduped) image_endpoint: same as above Both macros require carousel.css and carousel.js (loaded via base.html). Import with context so url_for is available: {% from '_macros/carousel.html' import gallery, carousel with context %} #} {# ────────────────────────────────────────────────────────────────── gallery — hero image + thumbnail strip ────────────────────────────────────────────────────────────────── #} {% macro gallery(images, image_endpoint, title='', show_badges=true) %} {% if images %} {% set hero = images[0] %} {% else %} {% endif %} {% endmacro %} {# ────────────────────────────────────────────────────────────────── carousel — horizontal sliding strip with lightbox ────────────────────────────────────────────────────────────────── #} {% macro carousel(images, image_endpoint) %} {% if images %} {% else %} {% endif %} {% endmacro %}