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

Unified Diff: sitescripts/stats/template/main.html

Issue 11481051: Update stats processing (Closed)
Patch Set: Improved performance using memoization Created Aug. 29, 2013, 1:39 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') | sitescripts/stats/test/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/main.html
===================================================================
rename from sitescripts/logs/template/subscriptionsMain.html
rename to sitescripts/stats/template/main.html
--- a/sitescripts/logs/template/subscriptionsMain.html
+++ b/sitescripts/stats/template/main.html
@@ -1,70 +1,71 @@
-<!--
- - This file is part of the Adblock Plus web scripts,
- - Copyright (C) 2006-2013 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" />
- <title>Statistics for filter subscriptions ({{month|monthname}})</title>
- </head>
-
- <body style="margin-top: 0px">
- <a name="top">&nbsp;</a>
- <table class="block" width="100%">
- <tr>
- <td class="title" width="250">Subscription statistics for:</td>
-
- <td>easylist-downloads.adblockplus.org</td>
- </tr>
- <tr>
- <td class="title" width="250">Last update:</td>
- <td>{{now|formattime}}</td>
- </tr>
- <tr>
- <td class="title" width="250">Reported period:</td>
- <td>Month {{month|monthname}}</td>
- </tr>
- </table>
- <div class="block_title">Subscriptions</div>
- <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')|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>
- </td>
- </tr>
- {%- endfor %}
- </table>
- </div>
- </body>
-</html>
+<!--
+ - This file is part of the Adblock Plus web scripts,
+ - Copyright (C) 2006-2013 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 charset="utf-8">
+ <link rel="stylesheet" type="text/css" href="../static/stats.css" />
+ <title>Download statistics for {{url}} ({{month|monthname}})</title>
+ </head>
+
+ <body style="margin-top: 0px">
+ <a name="top">&nbsp;</a>
+ <table class="block" width="100%">
+ <tr>
+ <td class="title" width="250">Download statistics for:</td>
+
+ <td>{{url}}</td>
+ </tr>
+ <tr>
+ <td class="title" width="250">Last update:</td>
+ <td>{{now|formattime}}</td>
+ </tr>
+ <tr>
+ <td class="title" width="250">Reported period:</td>
+ <td>Month {{month|monthname}}</td>
+ </tr>
+ </table>
+ <div class="block_title">File</div>
+ <div class="block">
+ <table align="center">
+ <tr>
+ <th bgcolor="#ECECEC">File</th>
+ <th bgcolor="#66DDEE">Hits</th>
+ <th bgcolor="#2EA495">Bandwidth</th>
+ <th>&nbsp;</th>
+ </tr>
+ {%- set data = data|sortfield("hits") %}
+ {%- 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>
+ </td>
+ </tr>
+ {%- endfor %}
+ </table>
+ </div>
+ </body>
+</html>
« no previous file with comments | « sitescripts/stats/template/fileStats.html ('k') | sitescripts/stats/test/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld