{# @description A trend stat with the change set beside the figure, on the same line, so the two are read as one statement. #} {# @prop title:text | description:"What the figure counts" #} {# @prop value:text | description:"The figure itself, already formatted" #} {# @prop change:text | description:"The size of the move, already formatted: 12%, 4, €1.2k. Left out, no arrow is drawn." #} {# @prop direction:select['up', 'down', 'flat'] | default:"up" | description:"Which way the figure moved" #} {# @prop inverse:boolean | default:False | description:"Set where a fall is the good news: lead time, failures, cost. It swaps which direction is coloured as good." #} {# @prop desc:text | description:"What the change is measured against: since last month" #} {# @prop icon:text | description:"An icon, by the name the project's icon component knows it by. Left out, there is no icon." #} {# @prop class:text | description:"Extra classes on the stat" #} {# @slot Under the figures — Room for a small chart of the run behind the number, from django-mvp-charts or anywhere else. This package draws none of its own. #} {# @slot:figure — In place of the icon, for anything that is not one: a picture, a logo, an avatar. #} {% comment %} Built on daisy-cotton's stat. The change wraps under the figure when the two cannot share a line. The icon sits to the right. {% endcomment %} {% if icon or figure %}{% if figure %}{{ figure }}{% else %}{% endif %} {% if title %}{{ title }}{% endif %} {{ value }} {% if change %}{% endif %} {% if desc or slot.strip %} {% if desc %}
{{ desc }}
{% endif %} {% if slot.strip %}
{{ slot }}
{% endif %}
{% endif %}