diff --git a/app/templates/views/dashboard/template-statistics.html b/app/templates/views/dashboard/template-statistics.html index 6e7b8e3a8..9acd142d6 100644 --- a/app/templates/views/dashboard/template-statistics.html +++ b/app/templates/views/dashboard/template-statistics.html @@ -1,47 +1,34 @@ +{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading, spark_bar_field %} +
{% if template_statistics|length > 1 %} -
- - - - - - - - - - - - - {% for item in template_statistics[:8] %} - - - - - - - - {% endfor %} - -
- Messages sent by template -
- Template name - - Folder - - Last used - - Created by - - # Times used -
- {{ item.template_name }} - - {{ 1|message_count_label(item.template_type, suffix='template')|capitalize }} - -

{{ item.template_folder }}

{{ item.last_used|format_datetime_table}}

{{ item.created_by }}

{{ item.count }}

- See templates by month +
+ {% call(item, row_number) list_table( + template_statistics, + caption="Messages sent by template", + caption_visible=False, + border_visible=True, + empty_message='', + field_headings=[ + 'Template', + 'Messages sent' + ], + field_headings_visible=False + ) %} + + {% call row_heading() %} + {{ item.template_name }} + + {{ 1|message_count_label(item.template_type, suffix='template')|capitalize }} + + {% endcall %} + + {{ spark_bar_field(item.count, most_used_template_count, id=item.template_id) }} + {% endcall %} + See templates used by month
{% endif %}