From 281c54b80b4db3c1ab7024116f272e7f26589fa3 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 9 Jun 2016 16:39:25 +0100 Subject: [PATCH] Make job counters smaller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/assets/stylesheets/components/big-number.scss | 10 ++++++++++ app/templates/components/big-number.html | 6 +++--- app/templates/views/dashboard/_jobs.html | 6 +++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/components/big-number.scss b/app/assets/stylesheets/components/big-number.scss index f9d0508be..f3a97af4a 100644 --- a/app/assets/stylesheets/components/big-number.scss +++ b/app/assets/stylesheets/components/big-number.scss @@ -26,6 +26,16 @@ } +.big-number-smallest { + + @extend %big-number; + + .big-number-number { + @include bold-24(); + } + +} + .big-number-with-status { @extend %big-number; diff --git a/app/templates/components/big-number.html b/app/templates/components/big-number.html index 3a2991b0f..062297855 100644 --- a/app/templates/components/big-number.html +++ b/app/templates/components/big-number.html @@ -1,11 +1,11 @@ -{% macro big_number(number, label, label_link=None, currency='', smaller=False) %} -
+{% macro big_number(number, label, label_link=None, currency='', smaller=False, smallest=False) %} +
{% if number is number %} {% if currency %} {{ "{}{:,.2f}".format(currency, number) }} {% else %} - {{ "{}{:,}".format(currency, number) }} + {{ "{:,}".format(number) }} {% endif %} {% else %} {{ number }} diff --git a/app/templates/views/dashboard/_jobs.html b/app/templates/views/dashboard/_jobs.html index 1360bb63a..a197fda07 100644 --- a/app/templates/views/dashboard/_jobs.html +++ b/app/templates/views/dashboard/_jobs.html @@ -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 %}