Files
notifications-admin/app/templates/components/big-number.html
Chris Hill-Scott 683baa0003 Separate thousands with comma for big numbers
Makes it easier to see just how big the numbers are.
2016-04-25 11:37:34 +01:00

31 lines
968 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% macro big_number(number, label) %}
<div class="big-number{% if right_aligned %}-right-aligned{% endif %}">
{% if number is number %}
{{ "{:,}".format(number) }}
{% else %}
{{ number }}
{% endif %}
<span class="big-number-label">{{ label }}</span>
</div>
{% endmacro %}
{% macro big_number_with_status(number, label, failures, failure_percentage, danger_zone=False, failure_link=None) %}
<div class="big-number-with-status">
{{ big_number(number, label) }}
<div class="big-number-status{% if danger_zone %}-failing{% endif %}">
{% if failures %}
{% if failure_link %}
<a href="{{ failure_link }}">
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
</a>
{% else %}
{{ "{:,}".format(failures) }} failed {{ failure_percentage }}%
{% endif %}
{% else %}
No failures
{% endif %}
</div>
</div>
{% endmacro %}