Add big number component…

…and count the messages to display some totals
This commit is contained in:
Chris Hill-Scott
2015-12-17 11:52:24 +00:00
parent aa0663cad8
commit 2acf599c04
6 changed files with 48 additions and 13 deletions

View File

@@ -0,0 +1,10 @@
.big-number {
@include bold-48;
&-label {
@include core-19;
display: block;
}
}

View File

@@ -27,6 +27,7 @@
@import '../govuk_elements/public/sass/elements/panels'; @import '../govuk_elements/public/sass/elements/panels';
@import '../govuk_elements/public/sass/elements/tables'; @import '../govuk_elements/public/sass/elements/tables';
// Specific to this application // Specific to this application
@import 'grids'; @import 'grids';
@import 'components/template-picker'; @import 'components/template-picker';
@@ -35,6 +36,9 @@
@import 'components/submit-form'; @import 'components/submit-form';
@import 'components/table'; @import 'components/table';
@import 'components/navigation'; @import 'components/navigation';
@import 'components/big-number';
@import 'views/job';
// TODO: break this up // TODO: break this up
@import 'app'; @import 'app';

View File

@@ -0,0 +1,3 @@
.job-totals {
margin-bottom: $gutter;
}

View File

@@ -0,0 +1,6 @@
{% macro big_number(number, label) %}
<div class="big-number">
{{ number }}
<span class="big-number-label">{{ label }}</span>
</div>
{% endmacro %}

View File

@@ -1,6 +1,6 @@
{% macro table(items, caption='', field_headings='', field_headings_visible=True) -%} {% macro table(items, caption='', field_headings='', field_headings_visible=True, caption_visible=True) -%}
<table class="table"> <table class="table">
<caption class="heading-medium table-heading"> <caption class="heading-medium table-heading{{ ' visuallyhidden' if not caption_visible}}">
{{ caption }} {{ caption }}
</caption> </caption>
<thead class="table-field-headings{% if field_headings_visible %}-visible{% endif %}"> <thead class="table-field-headings{% if field_headings_visible %}-visible{% endif %}">

View File

@@ -11,21 +11,33 @@ GOV.UK Notify | Notifications activity
{{ uploaded_file_name }} sent with {{ template_used }} {{ uploaded_file_name }} sent with {{ template_used }}
</h1> </h1>
<p> <ul class="grid-row job-totals">
{{ counts.total }} text messages <li class="column-one-third">
</p> {{ big_number(
counts.total,
'text message' if 1 == counts.total else 'text messages'
)}}
</li>
<li class="column-one-third">
{{ big_number(
counts.failed,
'failed delivery' if 1 == counts.failed else 'failed deliveries'
)}}
</li>
<li class="column-one-third">
{{ big_number(
cost, 'total cost'
)}}
</li>
</ul>
<p> <p>
{{ counts.failed }} failed deliveries You uploaded contact-demo.csv today at 13:42
</p> </p>
<p>
{{ cost }} total cost
</p>
{% call(item) table( {% call(item) table(
messages, messages,
caption='', caption='Messages',
caption_visible=False, caption_visible=False,
field_headings=[ field_headings=[
'To', 'To',