Files
notifications-admin/app/templates/components/big-number.html
Chris Hill-Scott e373296bd9 Show inbound messages on the dashboard
This commit adds two things:

a section on the dashboard to show how many inbound messages the
service has received in the last 7 days, and how recently an inbound
message has been received
---

Doesn’t show the contents of any messages, just like how the rest of the
dashboard is an aggregation, never individual messages.

a page to show all the inbound messages the service has received in
the last 7 days
---

This shows the first line of the message. Eventually this will link
through to a ‘conversation’ page, where a service can see all the
messages it’s received from a given phone number.
2017-06-05 15:42:36 +01:00

56 lines
1.5 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="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
) %}
<div class="big-number-with-status">
{{ big_number(number, label, link=link) }}
{% if show_failures %}
<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>
{% endif %}
</div>
{% endmacro %}