From c3d78f565251e85e4f4245bd32c69557ed216165 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 13 May 2016 10:11:56 +0100 Subject: [PATCH] =?UTF-8?q?Show=20template=20stats=20even=20if=20there?= =?UTF-8?q?=E2=80=99s=20only=201=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you’re only ever sending one template it’s really useful to be able to jump straight to that template from the dashboard. So this commit: - shows the template stats even if there’s only one row - hides the bar chart if there’s only one row (because it will always be 100%, and won’t be obvious what it is without its siblings) --- app/templates/views/dashboard/template-statistics.html | 6 +++++- app/templates/views/dashboard/today.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/templates/views/dashboard/template-statistics.html b/app/templates/views/dashboard/template-statistics.html index 1d3f8e2ac..80e12fdd7 100644 --- a/app/templates/views/dashboard/template-statistics.html +++ b/app/templates/views/dashboard/template-statistics.html @@ -11,10 +11,14 @@
+ {% if template_statistics|length > 1 %} - + {{ item.usage_count }} {{ message_count_label(item.usage_count, item.template.template_type) }} + {% else %} + {{ item.usage_count }} {{ message_count_label(item.usage_count, item.template.template_type) }} + {% endif %}
diff --git a/app/templates/views/dashboard/today.html b/app/templates/views/dashboard/today.html index be28c2b10..b3058951e 100644 --- a/app/templates/views/dashboard/today.html +++ b/app/templates/views/dashboard/today.html @@ -40,7 +40,7 @@ - {% if template_statistics|length > 1 %} + {% if template_statistics|length %} {% include 'views/dashboard/template-statistics.html' %} {{ show_more( url_for('.template_history', service_id=current_service.id),