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

Unified Diff: sitescripts/stats/template/fileStats.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/fileOverview.html ('k') | sitescripts/stats/template/main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/fileStats.html
===================================================================
--- a/sitescripts/stats/template/fileStats.html
+++ b/sitescripts/stats/template/fileStats.html
@@ -83,23 +83,23 @@
{{name}}
{%- endif -%}
{%- if filtered_url %}
</a>
{%- endif %}
</td>
<td align="right">{{value.hits}}</td>
- <td align="right">{{(value.hits / params.totalhits * 100)|round(precision=1)}}%</td>
+ <td align="right">{{value.hits|percentage(params.totalhits)|round(precision=1)}}%</td>
<td align="right">{{value.bandwidth|bytes}}</td>
- <td align="right">{{(value.bandwidth / params.totalbandwidth * 100)|round(precision=1)}}%</td>
+ <td align="right">{{value.bandwidth|percentage(params.totalbandwidth)|round(precision=1)}}%</td>
{%- if chart %}
<td class="chart">
- <div class="hitsChart" style="width: {{(value.hits / params.maxhits * 100)|round(method='ceil')|int}}px;"></div><br />
- <div class="bandwidthChart" style="width: {{(value.bandwidth / params.maxbandwidth * 100)|round(method='ceil')|int}}px;"></div>
+ <div class="hitsChart" style="width: {{value.hits|percentage(params.maxhits)|round(method='ceil')|int}}px;"></div><br />
+ <div class="bandwidthChart" style="width: {{value.bandwidth|percentage(params.maxbandwidth)|round(method='ceil')|int}}px;"></div>
</td>
{%- else %}
<td>&nbsp;</td>
{%- endif %}
</tr>
{%- endmacro %}
{# Using selectattr filter would be nice but servers don't have Jinja 2.7 yet #}
« no previous file with comments | « sitescripts/stats/template/fileOverview.html ('k') | sitescripts/stats/template/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld