Refactor letters code for usage page

No functional changes, but this changes the letter details that are
used for the usage page from a tuple to a named tuple since this makes
it easier to understand.
This commit is contained in:
Katie Smith
2020-07-03 17:39:45 +01:00
parent 0f29b3d64c
commit 2a6691f665
2 changed files with 13 additions and 6 deletions

View File

@@ -108,9 +108,9 @@
{{- ' {:.2f}p'.format(sms_rate * 100) }}</li>
{% endif %}
{% for letter in month.letters%}
{% if letter[0] %}
<li class="tabular-numbers">{{ "{:,} {}".format(letter[0], letter[3])}} class {{ message_count_label(letter[0], 'letter', '') }}at
{{ '{:.0f}p'.format(letter[1] * 100) }}</li>
{% if letter.billing_units %}
<li class="tabular-numbers">{{ "{:,} {}".format(letter.billing_units, letter.postage)}} class {{ message_count_label(letter.billing_units, 'letter', '') }}at
{{ '{:.0f}p'.format(letter.rate * 100) }}</li>
{% endif %}
{% endfor %}
{% if not (month.free or month.paid or month.letters) %}