2016-06-08 15:41:02 +01:00
|
|
|
{% from "components/big-number.html" import big_number %}
|
2016-05-13 09:58:07 +01:00
|
|
|
{% from "components/message-count-label.html" import message_count_label %}
|
2016-06-07 16:35:03 +01:00
|
|
|
{% from "components/big-number.html" import big_number %}
|
2017-02-16 15:08:16 +00:00
|
|
|
{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading, spark_bar_field %}
|
2019-10-25 15:52:22 +01:00
|
|
|
{% from "components/show-more.html" import show_more %}
|
2016-05-03 13:25:22 +01:00
|
|
|
|
2019-10-25 15:52:22 +01:00
|
|
|
<div class="ajax-block-container">
|
|
|
|
|
{% if template_statistics|length > 1 %}
|
2020-02-18 16:16:51 +00:00
|
|
|
<div class='template-statistics-table'>
|
2019-10-25 15:52:22 +01:00
|
|
|
{% call(item, row_number) list_table(
|
|
|
|
|
template_statistics,
|
2020-02-18 16:16:51 +00:00
|
|
|
caption="By template",
|
|
|
|
|
caption_visible=True,
|
2019-10-25 15:52:22 +01:00
|
|
|
empty_message='',
|
|
|
|
|
field_headings=[
|
|
|
|
|
'Template',
|
|
|
|
|
'Messages sent'
|
|
|
|
|
],
|
2020-02-18 16:16:51 +00:00
|
|
|
field_headings_visible=False
|
2019-10-25 15:52:22 +01:00
|
|
|
) %}
|
2016-10-13 10:52:09 +01:00
|
|
|
|
2019-10-25 15:52:22 +01:00
|
|
|
{% call row_heading() %}
|
|
|
|
|
{% if item.is_precompiled_letter %}
|
2020-02-18 16:16:51 +00:00
|
|
|
<span class="template-statistics-table-template-name">
|
2019-10-25 15:52:22 +01:00
|
|
|
Provided as PDF
|
|
|
|
|
</span>
|
2020-02-18 16:16:51 +00:00
|
|
|
<span class="template-statistics-table-hint">
|
2019-10-25 15:52:22 +01:00
|
|
|
Letter
|
|
|
|
|
</span>
|
|
|
|
|
{% else %}
|
2019-12-06 07:53:46 +00:00
|
|
|
<a class="govuk-link govuk-link--no-visited-state template-statistics-table-template-name" href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.template_id) }}">{{ item.template_name }}</a>
|
2020-02-18 16:16:51 +00:00
|
|
|
<span class="template-statistics-table-hint">
|
2019-10-25 15:52:22 +01:00
|
|
|
{{ message_count_label(1, item.template_type, suffix='template')|capitalize }}
|
|
|
|
|
</span>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endcall %}
|
2020-02-18 16:16:51 +00:00
|
|
|
|
2019-10-30 10:46:48 +00:00
|
|
|
{{ spark_bar_field(item.count, most_used_template_count, id=item.template_id) }}
|
2017-02-15 14:01:52 +00:00
|
|
|
{% endcall %}
|
2019-10-25 15:52:22 +01:00
|
|
|
{{ show_more(
|
|
|
|
|
url_for('.template_usage', service_id=current_service.id),
|
2020-02-18 16:16:51 +00:00
|
|
|
'See templates used by month',
|
|
|
|
|
with_border=False
|
2019-10-25 15:52:22 +01:00
|
|
|
) }}
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2016-06-17 15:03:34 +01:00
|
|
|
</div>
|