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

Side by Side Diff: sitescripts/logs/template/subscription.html

Issue 9503001: Subscription stats: Make sure there can be no division by zero errors (Closed)
Patch Set: Created March 1, 2013, 8:05 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .hgsubstate ('k') | sitescripts/logs/template/subscriptionOverview.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 - This file is part of the Adblock Plus web scripts, 2 - This file is part of the Adblock Plus web scripts,
3 - Copyright (C) 2006-2012 Eyeo GmbH 3 - Copyright (C) 2006-2012 Eyeo GmbH
4 - 4 -
5 - Adblock Plus is free software: you can redistribute it and/or modify 5 - Adblock Plus is free software: you can redistribute it and/or modify
6 - it under the terms of the GNU General Public License version 3 as 6 - it under the terms of the GNU General Public License version 3 as
7 - published by the Free Software Foundation. 7 - published by the Free Software Foundation.
8 - 8 -
9 - Adblock Plus is distributed in the hope that it will be useful, 9 - Adblock Plus is distributed in the hope that it will be useful,
10 - but WITHOUT ANY WARRANTY; without even the implied warranty of 10 - but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 30 matching lines...) Expand all
41 <tr> 41 <tr>
42 <td class="title" width="250">Reported period:</td> 42 <td class="title" width="250">Reported period:</td>
43 <td>Month {{month|monthname}} (<a href="{{overviewURL}}">To overview pag e</a>)</td> 43 <td>Month {{month|monthname}} (<a href="{{overviewURL}}">To overview pag e</a>)</td>
44 </tr> 44 </tr>
45 </table> 45 </table>
46 46
47 <div class="block_title">Days of month</div> 47 <div class="block_title">Days of month</div>
48 <div class="block"> 48 <div class="block">
49 <table align="center" style="margin-bottom: 20px;"> 49 <table align="center" style="margin-bottom: 20px;">
50 <tr align="bottom"> 50 <tr align="bottom">
51 {%- set maxHits, maxBandwidth = day|max(attribute='hits'), day|max(att ribute='bandwidth') %} 51 {%- set maxHits = day|max(attribute='hits')|ensuremin(1) %}
52 {%- set totalHits = day|sum(attribute='hits') %} 52 {%- set maxBandwidth = day|max(attribute='bandwidth')|ensuremin(1) %}
53 {%- set totalBandwidth = day|sum(attribute='bandwidth') %} 53 {%- set totalHits = day|sum(attribute='hits')|ensuremin(1) %}
54 {%- set totalBandwidth = day|sum(attribute='bandwidth')|ensuremin(1) % }
54 {%- set dayCount = day|length %} 55 {%- set dayCount = day|length %}
55 {%- if currentMonth and dayCount > 1 %} 56 {%- if currentMonth and dayCount > 1 %}
56 {%- set totalHits = totalHits - day[-1].hits %} 57 {%- set totalHits = totalHits - day[-1].hits %}
57 {%- set totalBandwidth = totalBandwidth - day[-1].bandwidth %} 58 {%- set totalBandwidth = totalBandwidth - day[-1].bandwidth %}
58 {%- set dayCount = dayCount - 1 %} 59 {%- set dayCount = dayCount - 1 %}
59 {%- endif %} 60 {%- endif %}
60 {%- for info in day %} 61 {%- for info in day %}
61 <td align="center" style="vertical-align: bottom;"> 62 <td align="center" style="vertical-align: bottom;">
62 <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="h eight: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div> 63 <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="h eight: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div>
63 {{- '' -}} 64 {{- '' -}}
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 <td class="chart"> 370 <td class="chart">
370 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br /> 371 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br />
371 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> 372 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
372 </td> 373 </td>
373 </tr> 374 </tr>
374 {%- endfor %} 375 {%- endfor %}
375 </table> 376 </table>
376 </div> 377 </div>
377 </body> 378 </body>
378 </html> 379 </html>
OLDNEW
« no previous file with comments | « .hgsubstate ('k') | sitescripts/logs/template/subscriptionOverview.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld