{% load vantage vantage_list i18n %}{% comment %} The analytics strip, above the table. Decision 1: this is the *opt-in* affordance. It renders only because the panel author wrote `list_stats` or `list_charts`, and it is capped at one row of cards, because the failure mode being avoided is Filament's — 140px of chrome above the thing the user came for, on every page load, whether or not it earns the space. Every figure here is computed from the filtered queryset before pagination, so the strip always answers for the same rows the table is about. {% endcomment %} {% if analytics.deferred %} {% comment %} Over budget. Offer the work rather than doing it: a list page must never be slower because stats exist. {% endcomment %}

{% translate "Statistics are not computed for this view." %}

{% if analytics.reason %}

{{ analytics.reason }}.

{% endif %}
{% translate "Compute" %}
{% else %} {% if analytics.stats %}
{% for stat in analytics.stats|slice:":4" %} {% include "vantage/partials/stat_card.html" with stat=stat %} {% endfor %}
{% endif %} {% if analytics.charts %}
{% for chart in analytics.charts %}

{{ chart.label }}

{% if chart.bucket %} {% blocktranslate with bucket=chart.bucket %}by {{ bucket }}{% endblocktranslate %} {% endif %}
{% if chart.error %}

{{ chart.error }}

{% elif chart.empty %}

{% translate "No data in range." %}

{% else %} {% chart_svg chart %} {% if chart.kind == "donut" or chart.kind == "bar" %}
    {% for label in chart.labels|slice:":6" %}
  • {{ label }}
  • {% endfor %}
{% elif chart.labels %}
{{ chart.labels|first }} {{ chart.labels|last }}
{% endif %} {% if chart.truncated %}

{% blocktranslate trimmed %}Showing part of the data; the rest is grouped or beyond the point limit.{% endblocktranslate %}

{% endif %} {% endif %}
{% endfor %}
{% endif %} {% endif %}