mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-19 05:53:51 -04:00
31 lines
968 B
HTML
31 lines
968 B
HTML
{% 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 %}
|