From 2f68dc613c2f2a5da99835cad2f9326f9e0beadf Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 20 Mar 2017 12:00:22 +0000 Subject: [PATCH] Put template IDs back on the dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed as part of refactoring the code to generate the graphs of template usage on the dashboard: https://github.com/alphagov/notifications-admin/commit/4a226a7a29d83a4187ae2df089098bbdcebf2202#diff-cf78cb5c29a2d3c4d45b61d8617824b7L29 Didn’t realise that they were used by the functional tests. This commit puts them back while keeping the code reuse. --- app/templates/components/table.html | 5 +++-- app/templates/views/dashboard/template-statistics.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/templates/components/table.html b/app/templates/components/table.html index 62f74e851..393e6282e 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -135,10 +135,11 @@ {% macro spark_bar_field( count, - max_count + max_count, + id=None ) %} {% call field(align='right') %} - + {{ big_number( count, diff --git a/app/templates/views/dashboard/template-statistics.html b/app/templates/views/dashboard/template-statistics.html index 9f3e0fab7..2c3833655 100644 --- a/app/templates/views/dashboard/template-statistics.html +++ b/app/templates/views/dashboard/template-statistics.html @@ -25,7 +25,7 @@ {% endcall %} {% if template_statistics|length > 1 %} - {{ spark_bar_field(item.count, most_used_template_count) }} + {{ spark_bar_field(item.count, most_used_template_count, id=item.template_id) }} {% else %} {% call field() %}