mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
https://www.pivotaltracker.com/story/show/116052359 - add absolute numbers for failures - make percentages accurate to 1 decimal place (50.0%) - make error colour appear if failures go above 3.0% - make error colour boolean (don’t interpolate between the colours)
21 lines
585 B
HTML
21 lines
585 B
HTML
{% macro big_number(number, label) %}
|
||
<div class="big-number">
|
||
{{ number }}
|
||
<span class="big-number-label">{{ label }}</span>
|
||
</div>
|
||
{% endmacro %}
|
||
|
||
|
||
{% macro big_number_with_status(number, label, failures, failure_percentage, danger_zone=False) %}
|
||
<div class="big-number-with-status">
|
||
{{ big_number(number, label) }}
|
||
<div class="big-number-status{% if danger_zone %}-failing{% endif %}">
|
||
{% if failures %}
|
||
{{ failures }} failed – {{ failure_percentage }}%
|
||
{% else %}
|
||
No failures
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
{% endmacro %}
|