Add a template to show letter usage if the service has the letter permission

This commit is contained in:
Rebecca Law
2017-12-20 16:28:40 +00:00
parent b7db7debc5
commit e7f94bd007
4 changed files with 196 additions and 33 deletions

View File

@@ -17,14 +17,14 @@
</div>
<div id='pill-selected-item'>
<div class='grid-row'>
<div class='column-one-third'>
<div class='column-half'>
<h2 class='heading-small'>Emails</h2>
<div class="keyline-block">
{{ big_number(emails_sent, 'sent', smaller=True) }}
{{ big_number("Unlimited", 'free allowance', smaller=True) }}
</div>
</div>
<div class='column-one-third'>
<div class='column-half'>
<h2 class='heading-small'>Text messages</h2>
<div class="keyline-block">
{{ big_number(sms_sent, 'sent', smaller=True) }}
@@ -39,21 +39,15 @@
{% endif %}
</div>
</div>
<div class='column-one-third'>
<h2 class='heading-small'>Letters</h2>
<div class="keyline-block">
{{ big_number(letter_sent, 'sent', smaller=True) }}
</div>
</div>
</div>
<div class='grid-row'>
<div class='column-one-third'>
<div class='column-half'>
<div class="keyline-block">
&nbsp;
</div>
</div>
<div class='column-one-third'>
<div class='column-half'>
<div class="keyline-block">
{{ big_number(
(sms_chargeable * sms_rate),
@@ -63,17 +57,6 @@
) }}
</div>
</div>
<div class='column-one-third'>
<div class="keyline-block">
{{ big_number(
letter_cost,
'spent',
currency="£",
smaller=True
) }}
</div>
</div>
</div>
{% if months %}
@@ -94,11 +77,11 @@
{% endcall %}
{% call field(align='left') %}
{{ big_number(
(sms_rate * month.paid) + month.letter_total,
sms_rate * month.paid,
currency="£",
smallest=True
) }}
<ul>
<ul>
{% if month.free %}
<li class="tabular-numbers">{{ "{:,}".format(month.free) }} free text messages</li>
{% endif %}
@@ -110,14 +93,6 @@
<li aria-hidden="true"></li>
{% endif %}
</ul>
<ul>
{% for letter in month.letters%}
{% if letter[0] %}
<li class="tabular-numbers">{{ "{:,}".format(letter[0])}} letters at {{ '{:.0f}p'.format(letter[1] * 100) }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endcall %}
{% endcall %}
</div>
@@ -138,4 +113,4 @@
</div>
</div>
{% endblock %}
{% endblock %}