{# Reusable reputation display (Trust System — Phase 3). All macros read the *cached* UserReputation row (or None) — never recompute. `rep` is a UserReputation instance or None (e.g. seller has no row yet). Macros: rep_stars(rating) - small star row for a 0-5 rating (half-stars). rep_inline(rep) - "★★★★☆ 4.8 (26)" or "New Seller". rep_detail(rep, sales) - larger block for the seller panel / profile. #} {% macro rep_stars(rating) %} {% set full = rating|int %} {% set half = (rating - full) >= 0.5 %} {% endmacro %} {% macro rep_inline(rep) %} {% if rep and rep.review_count > 0 %} {{ rep_stars(rep.rating) }} {{ '%.1f'|format(rep.rating) }} ({{ rep.review_count }}) {% else %} New Seller {% endif %} {% endmacro %} {% macro rep_detail(rep) %}
No reviews yet.
{% endif %}