mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
143 lines
4.9 KiB
HTML
143 lines
4.9 KiB
HTML
{% from "components/big-number.html" import big_number %}
|
||
{% from "components/table.html" import list_table, field, hidden_field_heading, row_heading, text_field %}
|
||
{% from "components/page-header.html" import page_header %}
|
||
{% from "components/pill.html" import pill %}
|
||
|
||
{% extends "withnav_template.html" %}
|
||
|
||
{% block service_page_title %}
|
||
Usage
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
{{ page_header('Usage', size='medium') }}
|
||
|
||
<div class="bottom-gutter">
|
||
{{ pill(years, selected_year, big_number_args={'smallest': True}) }}
|
||
</div>
|
||
<div id='pill-selected-item'>
|
||
<div class='govuk-grid-row'>
|
||
|
||
<div class='govuk-grid-column-one-half'>
|
||
<h2 class='heading-small'>Text messages</h2>
|
||
<div class="keyline-block">
|
||
{{ big_number(sms_sent, 'sent', smaller=True) }}
|
||
{{ big_number(sms_free_allowance, 'free allowance', smaller=True) }}
|
||
{% if sms_free_allowance > 0 %}
|
||
{{ big_number(sms_allowance_remaining, 'free allowance remaining', smaller=True) }}
|
||
{% endif %}
|
||
{% for row in sms_breakdown %}
|
||
{% if row.charged_units > 0 %}
|
||
{{ big_number(
|
||
row.charged_units,
|
||
'at {:.2f} pence per message'.format(row.rate * 100),
|
||
smaller=True
|
||
) }}
|
||
{% endif %}
|
||
{% endfor %}
|
||
</div>
|
||
</div>
|
||
<div class='govuk-grid-column-one-half'>
|
||
<h2 class='heading-small' style="color: gray;">Emails</h2>
|
||
<div class="keyline-block" style="color: gray;">
|
||
{{ big_number(emails_sent, 'email disabled during SMS pilot', smaller=True) }}
|
||
{{ big_number("", '', smaller=True) }}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class='govuk-grid-row'>
|
||
<div class='govuk-grid-column-one-half'>
|
||
<div class="keyline-block">
|
||
{{ big_number(
|
||
sms_cost,
|
||
'spent',
|
||
currency="$",
|
||
smaller=True
|
||
) }}
|
||
</div>
|
||
</div>
|
||
<div class='govuk-grid-column-one-half'>
|
||
<div class="keyline-block">
|
||
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
|
||
{% if months %}
|
||
<div class="dashboard-table usage-table body-copy-table">
|
||
{% call(item, row_index) list_table(
|
||
months,
|
||
caption="Total spend",
|
||
caption_visible=False,
|
||
empty_message='',
|
||
field_headings=[
|
||
'By month',
|
||
hidden_field_heading('Text messages'),
|
||
hidden_field_heading('Cost'),
|
||
],
|
||
field_headings_visible=True
|
||
) %}
|
||
{% call row_heading() %}
|
||
{{ item.month }}
|
||
{% endcall %}
|
||
{% for counts, template_type in [
|
||
(item.sms_counts.0, 'sms'),
|
||
] %}
|
||
{% call field(align='left') %}
|
||
{{ big_number(
|
||
counts.requested,
|
||
counts.requested|message_count_label(template_type, suffix=''),
|
||
smallest=True,
|
||
) }}
|
||
{% if counts.requested %}
|
||
<span class="{{ 'failure-highlight' if counts.show_warning else '' }}">
|
||
{{ "{:,}".format(counts.failed) }} failed
|
||
</span>
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
{% endcall %}
|
||
{% endfor %}
|
||
{% call field(align='left') %}
|
||
{{ big_number(
|
||
item.sms_cost,
|
||
currency="$",
|
||
smallest=True
|
||
) }}
|
||
<ul>
|
||
{% if item.sms_free_allowance_used %}
|
||
<li class="tabular-numbers">{{ item.sms_free_allowance_used|format_thousands }} free {{ item.sms_free_count|message_count_label('sms', suffix='') }}</li>
|
||
{% endif %}
|
||
{% for sms in item.sms_breakdown %}
|
||
<li class="tabular-numbers">{{ sms.charged_units|message_count('sms') }} at
|
||
{{- ' {:.2f}p'.format(sms.rate * 100) }}</li>
|
||
{% endfor %}
|
||
{% if not (item.sms_free_allowance_used or item.sms_cost) %}
|
||
<li aria-hidden="true">–</li>
|
||
{% endif %}
|
||
</ul>
|
||
{% endcall %}
|
||
|
||
{% endcall %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="govuk-grid-row">
|
||
<div class="govuk-grid-column-one-third">
|
||
<p class="align-with-heading-copy">
|
||
Federal fiscal year ends September 30
|
||
</p>
|
||
</div>
|
||
<div class="govuk-grid-column-two-thirds">
|
||
<p class="align-with-heading-copy">
|
||
What counts as 1 text message?<br />
|
||
See <a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.pricing') }}">pricing</a>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
{% endblock %}
|