Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/stats/template/fileOverview.html

Issue 5664623214723072: Issue 1560 - ZeroDivisionError in sitescripts.stats.bin.pagegenerator (Closed)
Patch Set: Better work-around for zero divisors Created Nov. 12, 2014, 8:55 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/stats/bin/pagegenerator.py ('k') | sitescripts/stats/template/fileStats.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/fileOverview.html
===================================================================
--- a/sitescripts/stats/template/fileOverview.html
+++ b/sitescripts/stats/template/fileOverview.html
@@ -51,18 +51,18 @@
{%- set maxhits = data|maxhits %}
{%- set maxbandwidth = data|maxbandwidth %}
{%- for name, value in data|reverse %}
<tr>
<td><a href="{{value.url}}">{{name|monthname}}</a></td>
<td align="right">{{value.hits}}</td>
<td align="right">{{value.bandwidth|bytes}}</td>
<td class="chart">
- <div class="hitsChart" style="width: {{(value.hits / maxhits * 100)|round(method='ceil')|int}}px;"></div><br />
- <div class="bandwidthChart" style="width: {{(value.bandwidth / maxbandwidth * 100)|round(method='ceil')|int}}px;"></div>
+ <div class="hitsChart" style="width: {{value.hits|percentage(maxhits)|round(method='ceil')|int}}px;"></div><br />
+ <div class="bandwidthChart" style="width: {{value.bandwidth|percentage(maxbandwidth)|round(method='ceil')|int}}px;"></div>
</td>
</tr>
{%- endfor %}
{%- set totalhits = data|sumhits %}
{%- set totalbandwidth = data|sumbandwidth %}
<tr class="special">
<td class="emph">Total</td>
« no previous file with comments | « sitescripts/stats/bin/pagegenerator.py ('k') | sitescripts/stats/template/fileStats.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld