Add usage to the dashboard

Takes the number of emails and SMS fragments sent from:
https://github.com/alphagov/notifications-api/pull/273

Using these numbers it’s possible to show:
- how much of your allowance is left
- or how much you have spent

For now the allowance and rates are hard coded.

Only for users that have manage service.
This commit is contained in:
Chris Hill-Scott
2016-04-20 15:37:17 +01:00
parent f6ba5ec8d0
commit 00030bc254
14 changed files with 197 additions and 13 deletions

View File

@@ -1,7 +1,11 @@
{% macro big_number(number, label, label_link=None) %}
{% macro big_number(number, label, label_link=None, currency='', right_aligned=False) %}
<div class="big-number{% if right_aligned %}-right-aligned{% endif %}">
{% if number is number %}
{{ "{:,}".format(number) }}
{% if currency %}
{{ "{}{:,.2f}".format(currency, number) }}
{% else %}
{{ "{}{:,}".format(currency, number) }}
{% endif %}
{% else %}
{{ number }}
{% endif %}