Make job counters smaller

With sending, delivered and failed all on one line there’s not much
space. When these numbers get relatively big (in the 000s) they can
start mushing into each other.

This commit makes them smaller so that they remain separate.
This commit is contained in:
Chris Hill-Scott
2016-06-09 16:39:25 +01:00
parent 4077e2860d
commit 281c54b80b
3 changed files with 16 additions and 6 deletions

View File

@@ -26,6 +26,16 @@
}
.big-number-smallest {
@extend %big-number;
.big-number-number {
@include bold-24();
}
}
.big-number-with-status {
@extend %big-number;

View File

@@ -1,11 +1,11 @@
{% macro big_number(number, label, label_link=None, currency='', smaller=False) %}
<div class="big-number{% if smaller %}-smaller{% endif %}">
{% macro big_number(number, label, label_link=None, currency='', smaller=False, smallest=False) %}
<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(currency, number) }}
{{ "{:,}".format(number) }}
{% endif %}
{% else %}
{{ number }}

View File

@@ -24,14 +24,14 @@
{% call field() %}
{{ big_number(
item.get('notifications_sent', 0) - item.get('notifications_delivered', 0) - item.get('notifications_failed', 0),
smaller=True
smallest=True
) }}
{% endcall %}
{% call field() %}
{{ big_number(item.get('notifications_delivered', 0), smaller=True) }}
{{ big_number(item.get('notifications_delivered', 0), smallest=True) }}
{% endcall %}
{% call field(status='error' if 0 else '') %}
{{ big_number(item.get('notifications_failed', 0), smaller=True) }}
{{ big_number(item.get('notifications_failed', 0), smallest=True) }}
{% endcall %}
{% endcall %}
</div>