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

Unified Diff: sitescripts/stats/template/main.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/template/fileStats.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/main.html
===================================================================
--- a/sitescripts/stats/template/main.html
+++ b/sitescripts/stats/template/main.html
@@ -55,17 +55,17 @@
{%- set maxhits = data|maxhits %}
{%- set maxbandwidth = data|maxbandwidth %}
{%- for name, value in data %}
<tr>
<td><a href="{{value.url}}">{{name}}</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 %}
</table>
</div>
</body>
</html>
« no previous file with comments | « sitescripts/stats/template/fileStats.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld