mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
Add big number component…
…and count the messages to display some totals
This commit is contained in:
10
app/assets/stylesheets/components/big-number.scss
Normal file
10
app/assets/stylesheets/components/big-number.scss
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.big-number {
|
||||||
|
|
||||||
|
@include bold-48;
|
||||||
|
|
||||||
|
&-label {
|
||||||
|
@include core-19;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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';
|
||||||
|
|||||||
3
app/assets/stylesheets/views/job.scss
Normal file
3
app/assets/stylesheets/views/job.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.job-totals {
|
||||||
|
margin-bottom: $gutter;
|
||||||
|
}
|
||||||
6
app/templates/components/big-number.html
Normal file
6
app/templates/components/big-number.html
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{% macro big_number(number, label) %}
|
||||||
|
<div class="big-number">
|
||||||
|
{{ number }}
|
||||||
|
<span class="big-number-label">{{ label }}</span>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
@@ -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 %}">
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user