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

Unified Diff: sitescripts/logs/template/subscriptionsMain.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.
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/logs/template/subscriptionOverview.html ('k') | sitescripts/templateFilters.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/logs/template/subscriptionsMain.html
===================================================================
--- a/sitescripts/logs/template/subscriptionsMain.html
+++ b/sitescripts/logs/template/subscriptionsMain.html
@@ -1,24 +1,24 @@
-<!--
- - This file is part of the Adblock Plus web scripts,
- - Copyright (C) 2006-2012 Eyeo GmbH
- -
- - Adblock Plus is free software: you can redistribute it and/or modify
- - it under the terms of the GNU General Public License version 3 as
- - published by the Free Software Foundation.
- -
- - Adblock Plus is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU General Public License for more details.
- -
- - You should have received a copy of the GNU General Public License
- - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- -->
+<!--
+ - This file is part of the Adblock Plus web scripts,
+ - Copyright (C) 2006-2012 Eyeo GmbH
+ -
+ - Adblock Plus is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU General Public License version 3 as
+ - published by the Free Software Foundation.
+ -
+ - Adblock Plus is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU General Public License for more details.
+ -
+ - You should have received a copy of the GNU General Public License
+ - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
+ -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="static/subscriptions.css" />
@@ -46,18 +46,18 @@
<div class="block">
<table align="center">
<tr>
<th bgcolor="#ECECEC">Subscription</th>
<th bgcolor="#66DDEE">Hits</th>
<th bgcolor="#2EA495">Bandwidth</th>
<th>&nbsp;</th>
</tr>
- {%- set maxHits = subscriptions|max(attribute='hits') %}
- {%- set maxBandwidth = subscriptions|max(attribute='bandwidth') %}
+ {%- set maxHits = subscriptions|max(attribute='hits')|ensuremin(1) %}
+ {%- set maxBandwidth = subscriptions|max(attribute='bandwidth')|ensuremin(1) %}
{%- for subscription in subscriptions %}
<tr>
<td><a href="{{subscription.url}}">{{subscription.fileName}}</a></td>
<td align="right">{{subscription.hits}}</td>
<td align="right">{{subscription.bandwidth|bytes}}</td>
<td class="chart">
<div class="hitsChart horizontal" style="width: {{(subscription.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br />
<div class="bandwidthChart horizontal" style="width: {{(subscription.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
« 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