{% from "better_stats/embed_modal.html" import embed_modal with context %} {% set content_id = (content_id_prefix if content_id_prefix is defined else "") + metric.name %} {% set is_favorite = is_favorite if is_favorite is defined else false %}
{# ── Header: icon + title | actions dropdown ── #}
{{ metric.title }} {% if metric.description %} {% include "better_stats/svg/info.svg" %} {% endif %}
{% if not embed and not current_user.is_anonymous %} {% endif %} {% if not embed %} {% endif %}
{# ── Pill-style viz switcher (only when >1 option) ── #} {% if metric.supported_visualizations | length > 1 %}
{% for viz in metric.supported_visualizations %} {% endfor %}
{% endif %} {# ── Visualization content (skeleton shown until JS loads data) ── #}
{# ── Footer: cache age | expand ── #} {% if not embed %} {% endif %}
{# /.metric-card #}
{# /.metric-container #} {% if not embed %} {{ embed_modal(metric) }} {% endif %}