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

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

Issue 9503001: Subscription stats: Make sure there can be no division by zero errors (Closed)
Patch Set: Fixed the issue in all the relevant places now Created March 1, 2013, 8:29 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 | « sitescripts/logs/template/subscriptionOverview.html ('k') | sitescripts/templateFilters.py » ('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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 </table> 44 </table>
45 <div class="block_title">Subscriptions</div> 45 <div class="block_title">Subscriptions</div>
46 <div class="block"> 46 <div class="block">
47 <table align="center"> 47 <table align="center">
48 <tr> 48 <tr>
49 <th bgcolor="#ECECEC">Subscription</th> 49 <th bgcolor="#ECECEC">Subscription</th>
50 <th bgcolor="#66DDEE">Hits</th> 50 <th bgcolor="#66DDEE">Hits</th>
51 <th bgcolor="#2EA495">Bandwidth</th> 51 <th bgcolor="#2EA495">Bandwidth</th>
52 <th>&nbsp;</th> 52 <th>&nbsp;</th>
53 </tr> 53 </tr>
54 {%- set maxHits = subscriptions|max(attribute='hits') %} 54 {%- set maxHits = subscriptions|max(attribute='hits')|ensuremin(1) %}
55 {%- set maxBandwidth = subscriptions|max(attribute='bandwidth') %} 55 {%- set maxBandwidth = subscriptions|max(attribute='bandwidth')|ensuremin( 1) %}
56 {%- for subscription in subscriptions %} 56 {%- for subscription in subscriptions %}
57 <tr> 57 <tr>
58 <td><a href="{{subscription.url}}">{{subscription.fileName}}</a></td> 58 <td><a href="{{subscription.url}}">{{subscription.fileName}}</a></td>
59 <td align="right">{{subscription.hits}}</td> 59 <td align="right">{{subscription.hits}}</td>
60 <td align="right">{{subscription.bandwidth|bytes}}</td> 60 <td align="right">{{subscription.bandwidth|bytes}}</td>
61 <td class="chart"> 61 <td class="chart">
62 <div class="hitsChart horizontal" style="width: {{(subscription.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> 62 <div class="hitsChart horizontal" style="width: {{(subscription.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br />
63 <div class="bandwidthChart horizontal" style="width: {{(subscription.b andwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> 63 <div class="bandwidthChart horizontal" style="width: {{(subscription.b andwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
64 </td> 64 </td>
65 </tr> 65 </tr>
66 {%- endfor %} 66 {%- endfor %}
67 </table> 67 </table>
68 </div> 68 </div>
69 </body> 69 </body>
70 </html> 70 </html>
OLDNEW
« no previous file with comments | « sitescripts/logs/template/subscriptionOverview.html ('k') | sitescripts/templateFilters.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld