Files
notifications-admin/app/templates/components/big-number.html
Jonathan Bobel e0d2d74067 Update dashboard and template flow (#514)
* Updated header and footer
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Updated fonts
* Adjusted grid templating
* Adding images to assets
* Updated account pages, dashboard, and pages in message sending flow
* Updated the styling for the landing pages in the account section once logged in
2023-06-08 13:12:00 -04:00

76 lines
2.1 KiB
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, link=None, currency='', smaller=False, smallest=False) %}
{% if link %}
<a class="usa-link govuk-link--no-visited-state display-block margin-bottom-1" href="{{ link }}">
{% endif %}
<span class="big-number{% if smaller %}-smaller{% endif %}{% if smallest %}-smallest{% endif %}">
<span class="big-number-number">
{% if number is number %}
{% if currency %}
{{ "{}{:,.2f}".format(currency, number) }}
{% else %}
{{ "{:,}".format(number) }}
{% endif %}
{% else %}
{{ number }}
{% endif %}
</span>
{% if label %}
<span class="big-number-label">{{ label }}</span>
{% endif %}
</span>
{% if link %}
</a>
{% endif %}
{% endmacro %}
{% macro big_number_with_status(
number,
label,
failures,
failure_percentage,
danger_zone=False,
failure_link=None,
link=None,
show_failures=True,
smaller=False,
smallest=False
) %}
<span class="big-number-with-status">
{{ big_number(number, label, link=link, smaller=smaller, smallest=smallest) }}
{% if show_failures %}
<span class="big-number-status{% if danger_zone %}-failing{% endif %}">
{% if failures %}
{% if failure_link %}
<a class="govuk-link govuk-link--no-visited-state" href="{{ failure_link }}">
{{ "{:,}".format(failures) }}
failed {{ failure_percentage }}%
</a>
{% else %}
{{ "{:,}".format(failures) }}
failed {{ failure_percentage }}%
{% endif %}
{% else %}
No failures
{% endif %}
</span>
{% endif %}
</span>
{% endmacro %}
{% macro big_number_simple(number, label) %}
<span class="big-number-dark bottom-gutter-2-3">
<span class="big-number-number">
{% if number is number %}
{{ "{:,}".format(number) }}
{% else %}
{{ number }}
{% endif %}
</span>
{% if label %}
<span class="big-number-label">{{ label }}</span>
{% endif %}
</span>
{% endmacro %}