Files
notifications-admin/app/templates/components/big-number.html
Tom Byers ee9f348ce4 Update all links to use GOVUK Frontend style
Includes:
- turning off :visited styles to match existing
  design
- swapping heading classes used to make links bold
  for the GOVUK Frontend bold override class
- adding visually hidden text to some links to
  make them work when isolated from their context

We may need to revisit whether some links, such as
those for documentation and features, may benefit
from having some indication that their target has
been visited.
2020-02-25 10:47:24 +00:00

76 lines
2.0 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="govuk-link govuk-link--no-visited-state big-number-link" href="{{ link }}">
{% endif %}
<div class="big-number{% if smaller %}-smaller{% endif %}{% if smallest %}-smallest{% endif %}">
<div class="big-number-number">
{% if number is number %}
{% if currency %}
{{ "{}{:,.2f}".format(currency, number) }}
{% else %}
{{ "{:,}".format(number) }}
{% endif %}
{% else %}
{{ number }}
{% endif %}
</div>
{% if label %}
<span class="big-number-label">{{ label }}</span>
{% endif %}
</div>
{% 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
) %}
<div class="big-number-with-status">
{{ big_number(number, label, link=link, smaller=smaller, smallest=smallest) }}
{% if show_failures %}
<div 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 %}
</div>
{% endif %}
</div>
{% endmacro %}
{% 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 %}