{#
How a number moved, as an arrow, a sign and a percentage.
Never colour alone: the arrow says the direction and the sign is printed, so
the badge still reads in monochrome, in print, and to anyone who cannot tell
the green from the red. Nothing is rendered when there is nothing to compare
against -- the first half of the window being empty makes every percentage
infinite, and "+∞%" is a worse answer than no badge.
#}
{% if series.delta is not none %}
{% set direction = "up" if series.delta > 0 else ("down" if series.delta < 0 else "flat") %}
{{ ff_icon("trending-up" if direction == "up" else ("trending-down" if direction == "down" else "minus"), size=14) }}
{{ "+" if series.delta > 0 }}{{ series.delta }}%
{{ _("vs previous {days} days", days=series.half) }}
{% elif not series.empty %}
{#
Rendering nothing here left two cards side by side, one carrying "-36.7%"
and the other carrying a gap of the same size, with no way to tell whether
the comparison was absent or the change was zero. Absent has a reason and
the reason is short, so it is printed: the earlier half of the window holds
nothing, which is what makes the percentage infinite rather than large.
Not on an empty card. There the whole card already says nothing happened,
and "no earlier activity" under "nothing in the last 30 days" is the same
sentence twice.
#}
{{ ff_icon("minus", size=14) }}
{{ _("No earlier activity to compare") }}
{% endif %}