2016-06-08 15:41:02 +01:00
|
|
|
|
{% macro big_number(number, label, link=None, currency='', smaller=False, smallest=False) %}
|
|
|
|
|
|
{% if link %}
|
|
|
|
|
|
<a class="big-number-link" href="{{ link }}">
|
|
|
|
|
|
{% endif %}
|
2016-06-09 16:39:25 +01:00
|
|
|
|
<div class="big-number{% if smaller %}-smaller{% endif %}{% if smallest %}-smallest{% endif %}">
|
2016-05-11 15:05:40 +01:00
|
|
|
|
<div class="big-number-number">
|
|
|
|
|
|
{% if number is number %}
|
|
|
|
|
|
{% if currency %}
|
|
|
|
|
|
{{ "{}{:,.2f}".format(currency, number) }}
|
|
|
|
|
|
{% else %}
|
2016-06-09 16:39:25 +01:00
|
|
|
|
{{ "{:,}".format(number) }}
|
2016-05-11 15:05:40 +01:00
|
|
|
|
{% endif %}
|
2016-04-20 15:37:17 +01:00
|
|
|
|
{% else %}
|
2016-05-11 15:05:40 +01:00
|
|
|
|
{{ number }}
|
2016-04-20 15:37:17 +01:00
|
|
|
|
{% endif %}
|
2016-05-11 15:05:40 +01:00
|
|
|
|
</div>
|
2016-06-08 15:41:02 +01:00
|
|
|
|
{% if label %}
|
2016-04-29 15:47:31 +01:00
|
|
|
|
<span class="big-number-label">{{ label }}</span>
|
|
|
|
|
|
{% endif %}
|
2015-12-17 11:52:24 +00:00
|
|
|
|
</div>
|
2016-06-08 15:41:02 +01:00
|
|
|
|
{% if link %}
|
|
|
|
|
|
</a>
|
|
|
|
|
|
{% endif %}
|
2015-12-17 11:52:24 +00:00
|
|
|
|
{% endmacro %}
|
2016-03-17 11:45:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
2016-04-29 15:47:31 +01:00
|
|
|
|
{% macro big_number_with_status(
|
|
|
|
|
|
number,
|
|
|
|
|
|
label,
|
|
|
|
|
|
failures,
|
|
|
|
|
|
failure_percentage,
|
|
|
|
|
|
danger_zone=False,
|
|
|
|
|
|
failure_link=None,
|
2017-05-22 17:02:03 +01:00
|
|
|
|
link=None,
|
2017-10-02 12:34:10 +01:00
|
|
|
|
show_failures=True,
|
|
|
|
|
|
smaller=False,
|
2019-01-08 17:52:01 +00:00
|
|
|
|
smallest=False
|
2016-04-29 15:47:31 +01:00
|
|
|
|
) %}
|
2016-03-17 11:45:48 +00:00
|
|
|
|
<div class="big-number-with-status">
|
2017-10-02 12:34:10 +01:00
|
|
|
|
{{ big_number(number, label, link=link, smaller=smaller, smallest=smallest) }}
|
2017-05-22 17:02:03 +01:00
|
|
|
|
{% if show_failures %}
|
|
|
|
|
|
<div class="big-number-status{% if danger_zone %}-failing{% endif %}">
|
|
|
|
|
|
{% if failures %}
|
|
|
|
|
|
{% if failure_link %}
|
|
|
|
|
|
<a href="{{ failure_link }}">
|
2018-10-11 11:03:57 +01:00
|
|
|
|
{{ "{:,}".format(failures) }}
|
2019-01-08 17:52:01 +00:00
|
|
|
|
failed – {{ failure_percentage }}%
|
2017-05-22 17:02:03 +01:00
|
|
|
|
</a>
|
|
|
|
|
|
{% else %}
|
2018-10-11 11:03:57 +01:00
|
|
|
|
{{ "{:,}".format(failures) }}
|
2019-01-08 17:52:01 +00:00
|
|
|
|
failed – {{ failure_percentage }}%
|
2017-05-22 17:02:03 +01:00
|
|
|
|
{% endif %}
|
2016-04-19 12:57:55 +01:00
|
|
|
|
{% else %}
|
2019-01-08 17:52:01 +00:00
|
|
|
|
No failures
|
2016-04-19 12:57:55 +01:00
|
|
|
|
{% endif %}
|
2017-05-22 17:02:03 +01:00
|
|
|
|
</div>
|
|
|
|
|
|
{% endif %}
|
2016-03-17 11:45:48 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
{% endmacro %}
|
2018-06-25 13:34:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% macro big_number_simple(number, label) %}
|
|
|
|
|
|
<div class="big-number-dark bottom-gutter-2-3">
|
|
|
|
|
|
<div class="big-number-number">
|
|
|
|
|
|
{% if number is number %}
|
|
|
|
|
|
{{ "{:,}".format(number) }}
|
|
|
|
|
|
{% else %}
|
|
|
|
|
|
{{ number }}
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{% if label %}
|
|
|
|
|
|
<span class="big-number-label">{{ label }}</span>
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{% endmacro %}
|