From d69ae9f2cc2d243a79dd0e4dee38dd44bccab8c3 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 11 Apr 2013 10:16:09 -0400 Subject: Bug 860657 - 'Illegal division by zero' on product dashboard when the product has zero bugs --- .../pages/productdashboard/summary.html.tmpl | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'extensions/ProductDashboard/template') diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl index 5afba25a9..30b6f3dca 100644 --- a/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl +++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard/summary.html.tmpl @@ -11,36 +11,36 @@ // global counts PD.summary.bug_counts = [ - { + { name: "Total [% terms.Bugs %]", count: [% total_bugs || 0 FILTER js %], - percentage: 100, - link: 'Link', - }, + percentage: [% total_bugs ? "100" : "0" %], + link: 'Link', + }, { name: "Open [% terms.Bugs %]", count: [% total_open_bugs || 0 FILTER js %], percentage: [% open_bugs_percentage FILTER js %], - link: 'Link', + link: 'Link', }, { - name: "Closed [% terms.Bugs %]", + name: "Closed [% terms.Bugs %]", count: [% total_closed_bugs || 0 FILTER js %], percentage: [% closed_bugs_percentage FILTER js %], link: 'Link', } ]; - + // Status counts PD.summary.status_counts = [ [% FOREACH col = by_status %] [% NEXT IF col.0 == 'CLOSED' %] { - name: "[% col.0 FILTER js %]", + name: "[% col.0 FILTER js %]", count: [% col.1 || 0 FILTER js %], - percentage: [% col.2 || 0 FILTER js %], + percentage: [% col.2 || 0 FILTER js %], link: 'Link' - }, + }, [% END %] ]; @@ -48,11 +48,11 @@ PD.summary.priority_counts = [ [% FOREACH col = by_priority %] { - name: "[% col.0 FILTER js %]", + name: "[% col.0 FILTER js %]", count: [% col.1 || 0 FILTER js %], - percentage: [% col.2 || 0 FILTER js %], + percentage: [% col.2 || 0 FILTER js %], link: 'Link' - }, + }, [% END %] ]; @@ -60,11 +60,11 @@ PD.summary.severity_counts = [ [% FOREACH col = by_severity %] { - name: "[% col.0 FILTER js %]", + name: "[% col.0 FILTER js %]", count: [% col.1 || 0 FILTER js %], - percentage: [% col.2 || 0 FILTER js %], + percentage: [% col.2 || 0 FILTER js %], link: 'Link' - }, + }, [% END %] ]; -- cgit v1.2.3-24-g4f1b