Merge pull request #558 from alphagov/template-stats-2

Make template usage on dashboard easier to scan
This commit is contained in:
Chris Hill-Scott
2016-05-17 11:26:49 +01:00
13 changed files with 203 additions and 103 deletions

View File

@@ -1,14 +1,16 @@
{% macro big_number(number, label, label_link=None, currency='', smaller=False) %}
<div class="big-number{% if smaller %}-smaller{% endif %}">
{% if number is number %}
{% if currency %}
{{ "{}{:,.2f}".format(currency, number) }}
<div class="big-number-number">
{% if number is number %}
{% if currency %}
{{ "{}{:,.2f}".format(currency, number) }}
{% else %}
{{ "{}{:,}".format(currency, number) }}
{% endif %}
{% else %}
{{ "{}{:,}".format(currency, number) }}
{{ number }}
{% endif %}
{% else %}
{{ number }}
{% endif %}
</div>
{% if label_link %}
<a class="big-number-label" href="{{ label_link }}">{{ label }}</a>
<a class="big-number-overlay-link" href="{{ label_link }}" aria-hidden="true"></a>

View File

@@ -0,0 +1,15 @@
{% macro message_count_label(count, template_type) -%}
{%- if template_type == 'sms' -%}
{%- if count == 1 -%}
text message
{%- else -%}
text messages
{%- endif -%}
{%- elif template_type == 'email' -%}
{%- if count == 1 -%}
email
{%- else -%}
emails
{%- endif -%}
{%- endif %} sent
{%- endmacro %}

View File

@@ -0,0 +1,3 @@
{% macro show_more(url, label) %}
<a href="{{ url }}" class="show-more"><span>{{ label }}</span></a>
{% endmacro %}