From e704cb1b788460f5a5361b6a8b2b220903e0011a Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Thu, 29 Aug 2024 15:10:08 -0700 Subject: [PATCH] added template-stats.html --- app/templates/views/dashboard/dashboard.html | 1 + .../views/dashboard/template-statistics.html | 74 +++++++++++-------- 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index 9268b37e3..a2cb13580 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -137,6 +137,7 @@ +

Most Used Templates

{{ ajax_block(partials, updates_url, 'template-statistics') }} diff --git a/app/templates/views/dashboard/template-statistics.html b/app/templates/views/dashboard/template-statistics.html index 77efbea50..6e7b8e3a8 100644 --- a/app/templates/views/dashboard/template-statistics.html +++ b/app/templates/views/dashboard/template-statistics.html @@ -1,35 +1,47 @@ -{% from "components/table.html" import list_table, field, right_aligned_field_heading, row_heading, spark_bar_field %} -
- {% if template_statistics|length > 0 %} -

Recent templates

-
- {% 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 + {% 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
{% endif %}