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

Side by Side Diff: sitescripts/stats/template/fileStats.html

Issue 11481051: Update stats processing (Closed)
Patch Set: Created Aug. 23, 2013, 3:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
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-2013 Eyeo GmbH 3 - Copyright (C) 2006-2013 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
11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 - GNU General Public License for more details. 12 - GNU General Public License for more details.
13 - 13 -
14 - You should have received a copy of the GNU General Public License 14 - You should have received a copy of the GNU General Public License
15 - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 - along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 --> 16 -->
17 17
18
19 <!DOCTYPE html> 18 <!DOCTYPE html>
20 <html lang="en"> 19 <html lang="en">
21 <head> 20 <head>
22 <meta name="robots" content="noindex,nofollow" /> 21 <meta name="robots" content="noindex,nofollow" />
23 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 22 <meta charset="utf-8">
24 <link rel="stylesheet" type="text/css" href="static/subscriptions.css" /> 23 <link rel="stylesheet" type="text/css" href="../../../static/stats.css" />
25 <link rel="stylesheet" type="text/css" href="static/flags.css" /> 24 <link rel="stylesheet" type="text/css" href="../../../static/flags.css" />
26 <link rel="stylesheet" type="text/css" href="static/hours.css" /> 25 <link rel="stylesheet" type="text/css" href="../../../static/hours.css" />
27 <title>Statistics for filter subscription {{fileName}} ({{month|monthname}}) </title> 26 <title>Statistics for file {{fileName}} ({{month|monthname}})</title>
27 <script type="text/javascript">
28 document.addEventListener("click", function(event)
29 {
30 if (event.target.className == "showAllLink")
31 {
32 document.getElementById(event.target.getAttribute("data-hide")).style. display = "none";
33 document.getElementById(event.target.getAttribute("data-show")).style. display = "";
34 event.preventDefault();
35 }
36 }, false);
37 </script>
28 </head> 38 </head>
29 39
30 <body style="margin-top: 0px"> 40 <body style="margin-top: 0px">
31 <a name="top">&nbsp;</a> 41 <a name="top">&nbsp;</a>
32 <table class="block" width="100%"> 42 <table class="block" width="100%">
33 <tr> 43 <tr>
34 <td class="title" width="250">Statistics for subscription:</td> 44 <td class="title" width="250">Statistics for file:</td>
35 <td>easylist-downloads.adblockplus.org/{{fileName}}</td> 45 <td>{{url}}</td>
36 </tr> 46 </tr>
37 <tr> 47 <tr>
38 <td class="title" width="250">Last update:</td> 48 <td class="title" width="250">Last update:</td>
39 <td>{{now|formattime}}</td> 49 <td>{{now|formattime}}</td>
40 </tr> 50 </tr>
41 <tr> 51 <tr>
42 <td class="title" width="250">Reported period:</td> 52 <td class="title" width="250">Reported period:</td>
43 <td>Month {{month|monthname}} (<a href="{{overviewURL}}">To overview pag e</a>)</td> 53 <td>Month {{month|monthname}} (<a href="{{overview_url}}">To overview pa ge</a>)</td>
44 </tr> 54 </tr>
55 {%- if filter %}
56 <tr>
57 <td class="title" width="250">Filter:</td>
58 <td>
59 {%- if filter.field.filter %}
60 {{filter.field.title}} only
61 {%- else %}
62 {{filter.field.coltitle}} is {{filter.value}}
63 {%- endif %}
64 (<a href="index.html">Remove filter</a>)</td>
65 </tr>
66 {%- endif %}
45 </table> 67 </table>
46 68
47 <div class="block_title">Days of month</div> 69 {%- macro row(name, value, params, special=False, emph=False, chart=True, fi ltered_url=None) %}
48 <div class="block"> 70 <tr{% if special %} class="special"{% endif%}>
49 <table align="center" style="margin-bottom: 20px;"> 71 <td{% if emph %} class="emph"{% endif%}>
50 <tr align="bottom"> 72 {%- if filtered_url %}
51 {%- set maxHits = day|max(attribute='hits')|ensuremin(1) %} 73 <a href="{{filtered_url}}">
52 {%- set maxBandwidth = day|max(attribute='bandwidth')|ensuremin(1) %}
53 {%- set totalHits = day|sum(attribute='hits')|ensuremin(1) %}
54 {%- set totalBandwidth = day|sum(attribute='bandwidth')|ensuremin(1) % }
55 {%- set dayCount = day|length %}
56 {%- if currentMonth and dayCount > 1 %}
57 {%- set totalHits = totalHits - day[-1].hits %}
58 {%- set totalBandwidth = totalBandwidth - day[-1].bandwidth %}
59 {%- set dayCount = dayCount - 1 %}
60 {%- endif %} 74 {%- endif %}
61 {%- for info in day %} 75
62 <td align="center" style="vertical-align: bottom;"> 76 {%- if not special and params.field.name == "hour" -%}
63 <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="h eight: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div> 77 <div class="hour hour{{name|int % 12 + 1}}"></div> {{name}}
64 {{- '' -}} 78 {%- elif not special and params.field.name == "country" -%}
65 <div class="bandwidthChart vertical" title="Bandwidth: {{info.bandwi dth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method ='ceil')|int}}px;"></div> 79 <div class="flag {{name}}"></div> {{name|countryname}} <div class="c ountrycode">{{name}}</div>
80 {%- else -%}
81 {{name}}
82 {%- endif -%}
83
84 {%- if filtered_url %}
85 </a>
86 {%- endif %}
87 </td>
88 <td align="right">{{value.hits}}</td>
89 <td align="right">{{(value.hits / params.totalhits * 100)|round(precisio n=1)}}%</td>
90 <td align="right">{{value.bandwidth|bytes}}</td>
91 <td align="right">{{(value.bandwidth / params.totalbandwidth * 100)|roun d(precision=1)}}%</td>
92 {%- if chart %}
93 <td class="chart">
94 <div class="hitsChart" style="width: {{(value.hits / params.maxhits * 100)|round(method='ceil')|int}}px;"></div><br />
95 <div class="bandwidthChart" style="width: {{(value.bandwidth / param s.maxbandwidth * 100)|round(method='ceil')|int}}px;"></div>
66 </td> 96 </td>
67 {%- if loop.last and info.id|int < daysInMonth %} 97 {%- else %}
68 {%- for dummyDay in range(info.id|int + 1, daysInMonth + 1) %} 98 <td>&nbsp;</td>
69 <td align="center" style="vertical-align: bottom;"> 99 {%- endif %}
70 <div class="hitsChart vertical" title="Hits: 0" style="height: 1 px;"></div> 100 </tr>
71 {{- '' -}} 101 {%- endmacro %}
72 <div class="bandwidthChart vertical" title="Bandwidth: 1" style= "height: 1px;"></div>
73 </td>
74 {%- endfor %}
75 {%- endif %}
76 {%- endfor %}
77 {%- set avgHits = (totalHits / dayCount)|int %}
78 {%- set avgBandwidth = (totalBandwidth / dayCount)|int %}
79 <td align="center" style="vertical-align: bottom;">
80 <div class="hitsChart vertical" title="Hits: {{avgHits}}" style="hei ght: {{(avgHits / maxHits * 100)|round(method='ceil')|int}}px;"></div>
81 {{- '' -}}
82 <div class="bandwidthChart vertical" title="Bandwidth: {{avgBandwidt h|bytes}}" style="height: {{(avgBandwidth / maxBandwidth * 100)|round(method='ce il')|int}}px;"></div>
83 </td>
84 </tr>
85 <tr>
86 {%- for info in day %}
87 <td align="center"{% if info.weekday > 4 %} class="special"{% endif %} >
88 {{info.id}}<br />
89 {{month|monthname(format='%b')}}
90 </td>
91 {%- if loop.last and info.id|int < daysInMonth %}
92 {%- for dummyDay in range(info.id|int + 1, daysInMonth + 1) %}
93 <td align="center">
94 {{dummyDay}}<br />
95 {{month|monthname(format='%b')}}
96 </td>
97 {%- endfor %}
98 {%- endif %}
99 {%- endfor %}
100 <td align="center">
101 Average
102 </td>
103 </tr>
104 </table>
105 102
106 <table align="center"> 103 {# Using selectattr filter would be nice but servers don't have Jinja 2.7 ye t #}
107 <tr> 104 {%- set filterFields = [] %}
108 <th bgcolor="#ECECEC">Day</th> 105 {%- for field in fields %}
109 <th bgcolor="#66DDEE" colspan="2">Hits</th> 106 {%- if field.filter and field.name in data and "true" in data[field.name] %}
110 <th bgcolor="#2EA495">Bandwidth</th> 107 {%- set dummy = filterFields.append(field) %}
111 </tr> 108 {%- endif %}
112 {%- for info in day %} 109 {%- endfor %}
113 <tr{% if info.weekday > 4 %} class="special"{% endif %}> 110
114 <td>{{info.id}} {{month|monthname}}</td> 111 <div id="quickLinks">
115 <td align="right">{{info.hits}}</td> 112 {%- if filterFields|length > 0 %}
116 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td> 113 <a href="#overview">Overview</a>
117 <td align="right">{{info.bandwidth|bytes}}</td> 114 {%- endif %}
118 </tr> 115
119 {%- endfor %} 116 {%- for field in fields %}
120 <tr class="special"> 117 {%- if not field.filter and field.name in data %}
121 <td style="font-weight: bold">Average</td> 118 <a href="#{{field.name}}">{{field.title}}</a>
122 <td align="right">{{avgHits}}</td> 119 {%- endif %}
123 <td align="right">&nbsp;</td> 120 {%- endfor %}
124 <td align="right">{{avgBandwidth|bytes}}</td>
125 </tr>
126 <tr class="special">
127 <td style="font-weight: bold">Total</td>
128 <td align="right">{{totalHits}}</td>
129 <td align="right">&nbsp;</td>
130 <td align="right">{{totalBandwidth|bytes}}</td>
131 </tr>
132 </table>
133 </div> 121 </div>
134 122
135 <div class="block_title">Days of week</div> 123 {%- if filterFields|length > 0 %}
136 <div class="block"> 124 {%- if filter %}
137 <table align="center" style="margin-bottom: 20px;"> 125 {%- set params = {"totalhits": data.hits, "totalbandwidth": data.bandwid th, "field": {"name": None}} %}
138 <tr align="bottom"> 126 {%- else %}
139 {%- set maxHits = weekday|max(attribute='hits')|ensuremin(1) %} 127 {%- set items = data.day|sortfield("day") %}
140 {%- set maxBandwidth = weekday|max(attribute='bandwidth')|ensuremin(1) %} 128 {%- set params = {"totalhits": items|sumhits, "totalbandwidth": items|su mbandwidth, "field": {"name": None}} %}
141 {%- for info in weekday %} 129 {%- endif %}
142 <td align="center" style="vertical-align: bottom;"> 130 <div id="overview" class="block_title">Overview</div>
143 <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="h eight: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px"></div> 131 <div class="block">
144 {{- '' -}} 132 <table align="center">
145 <div class="bandwidthChart vertical" alt="Bandwidth: {{info.bandwidt h|bytes}}"" title="Bandwidth: {{info.bandwidth|bytes}}" style="height: {{(info.b andwidth / maxBandwidth * 100)|round(method='ceil')|int}}px"></div> 133 <tr>
146 </td> 134 <th bgcolor="#ECECEC">Condition</th>
135 <th bgcolor="#66DDEE" colspan="2">Hits</th>
136 <th bgcolor="#2EA495" colspan="2">Bandwidth</th>
137 </tr>
138 {%- for field in filterFields %}
139 {{row(field.title, data[field.name].true, params, chart=False,
140 filtered_url=filtered_urls.get(field.name, {}).get("true", Non e))}}
147 {%- endfor %} 141 {%- endfor %}
148 </tr> 142 {{row("Total", {"hits": params.totalhits, "bandwidth": params.totalban dwidth}, params, special=True, emph=True, chart=False)}}
149 <tr> 143 </table>
150 {%- for info in weekday %} 144 </div>
151 <td align="center"{% if info.id > 4 %} class="special"{% endif %}>
152 {{info.id|weekday}}
153 </td>
154 {%- endfor %}
155 </tr>
156 </table>
157
158 <table align="center">
159 <tr>
160 <th bgcolor="#ECECEC">Day</th>
161 <th bgcolor="#66DDEE" colspan="2">Hits</th>
162 <th bgcolor="#2EA495">Bandwidth</th>
163 </tr>
164 {%- set totalHits = weekday|sum(attribute='hits')|ensuremin(1) %}
165 {%- set totalBandwidth = weekday|sum(attribute='bandwidth')|ensuremin(1) %}
166 {%- for info in weekday %}
167 <tr{% if info.id > 4 %} class="special"{% endif %}>
168 <td>{{info.id|weekday}}</td>
169 <td align="right">{{info.hits}}</td>
170 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td>
171 <td align="right">{{info.bandwidth|bytes}}</td>
172 </tr>
173 {%- endfor %}
174 </table>
175 </div>
176
177 <div class="block_title">Hours</div>
178 <div class="block">
179 <table align="center" style="margin-bottom: 20px;">
180 <tr align="bottom">
181 {%- set maxHits = hour|max(attribute='hits')|ensuremin(1) %}
182 {%- set maxBandwidth = hour|max(attribute='bandwidth')|ensuremin(1) %}
183 {%- for info in hour %}
184 <td align="center" style="vertical-align: bottom;">
185 <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="h eight: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div>
186 {{- '' -}}
187 <div class="bandwidthChart vertical" title="Bandwidth: {{info.bandwi dth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method ='ceil')|int}}px;"></div>
188 </td>
189 {%- if loop.last and info.id|int < 23 %}
190 {%- for dummyHour in range(info.id|int + 1, 24) %}
191 <td align="center" style="vertical-align: bottom;">
192 <div class="hitsChart vertical" title="Hits: 0" style="height: 1 px;"></div>
193 {{- '' -}}
194 <div class="bandwidthChart vertical" title="Bandwidth: 0" style= "height: 1px;"></div>
195 </td>
196 {%- endfor %}
197 {%- endif %}
198 {%- endfor %}
199 </tr>
200 <tr>
201 {%- for info in hour %}
202 <td align="center">
203 {{info.id}}<br />
204 <div class="hour hour{{info.id|int % 12 + 1}}" ></div>
205 </td>
206 {%- if loop.last and info.id|int < 23 %}
207 {%- for dummyHour in range(info.id|int + 1, 24) %}
208 <td align="center">
209 {{dummyHour}}<br />
210 <div class="hour hour{{dummyHour % 12 + 1}}" ></div>
211 </td>
212 {%- endfor %}
213 {%- endif %}
214 {%- endfor %}
215 </tr>
216 </table>
217
218 <table align="center">
219 <tr>
220 <th bgcolor="#ECECEC">Hour</th>
221 <th bgcolor="#66DDEE" colspan="2">Hits</th>
222 <th bgcolor="#2EA495">Bandwidth</th>
223 </tr>
224 {%- set totalHits = hour|sum(attribute='hits')|ensuremin(1) %}
225 {%- set totalBandwidth = hour|sum(attribute='bandwidth')|ensuremin(1) %}
226 {%- for info in hour %}
227 <tr>
228 <td>{{info.id}}</td>
229 <td align="right">{{info.hits}}</td>
230 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td>
231 <td align="right">{{info.bandwidth|bytes}}</td>
232 </tr>
233 {%- endfor %}
234 </table>
235 </div>
236
237 {%- if app %}
238 <div class="block_title">Browsers</div>
239 <div class="block">
240 <table align="center">
241 <tr>
242 <th bgcolor="#ECECEC">Browser</th>
243 <th bgcolor="#66DDEE" colspan="2">Hits</th>
244 <th bgcolor="#2EA495">Bandwidth</th>
245 </tr>
246 {%- set maxHits = app|max(attribute='hits')|ensuremin(1) %}
247 {%- set maxBandwidth = app|max(attribute='bandwidth')|ensuremin(1) %}
248 {%- set totalHits = app|sum(attribute='hits')|ensuremin(1) %}
249 {%- set totalBandwidth = app|sum(attribute='bandwidth')|ensuremin(1) %}
250 {%- for info in app[0:10] %}
251 <tr>
252 <td>{{info.id}}</td>
253 <td align="right">{{info.hits}}</td>
254 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td>
255 <td align="right">{{info.bandwidth|bytes}}</td>
256 <td class="chart">
257 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br />
258 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
259 </td>
260 </tr>
261 {%- endfor %}
262 {%- if app|length > 10 %}
263 <tr class="special" id="showotherapps">
264 <td>
265 Other
266 <a href="#" style="font-size: 80%;" onclick="getElementById('showoth erapps').style.display='none';getElementById('otherapps').style.display='';retur n false;">
267 Show all
268 </a>
269 </td>
270 <td align="right">{{app[10:]|sum(attribute='hits')}}</td>
271 <td>&nbsp;</td>
272 <td align="right">{{app[10:]|sum(attribute='bandwidth')|bytes}}</td>
273 <td>&nbsp;</td>
274 </tr>
275 <tbody id="otherapps" style="display: none;">
276 {%- for info in app[10:] %}
277 <tr>
278 <td>{{info.id}}</td>
279 <td align="right">{{info.hits}}</td>
280 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1) }}%</td>
281 <td align="right">{{info.bandwidth|bytes}}</td>
282 <td class="chart">
283 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br />
284 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
285 </td>
286 </tr>
287 {%- endfor %}
288 </tbody>
289 {%- endif %}
290 </table>
291 </div>
292 {%- endif %} 145 {%- endif %}
293 146
294 <div class="block_title">Countries</div> 147 {%- for field in fields %}
295 <div class="block"> 148 {%- if not field.filter and field.name in data %}
296 <table align="center"> 149 {%- set items = data[field.name]|sortfield(field) %}
297 <tr> 150 {%- set params = {"maxhits": items|maxhits, "maxbandwidth": items|maxban dwidth,
298 <th bgcolor="#ECECEC" colspan="3">Country</th> 151 "totalhits": items|sumhits, "totalbandwidth": items|su mbandwidth,
299 <th bgcolor="#66DDEE" colspan="2">Hits</th> 152 "field": field} %}
300 <th bgcolor="#2EA495">Bandwidth</th> 153 {%- set count = items|length %}
301 <th>&nbsp;</th> 154 <div id="{{field.name}}" class="block_title">{{field.title}}</div>
302 </tr> 155 <div class="block">
303 {%- set maxHits = country|max(attribute='hits')|ensuremin(1) %} 156 <table align="center">
304 {%- set maxBandwidth = country|max(attribute='bandwidth')|ensuremin(1) % } 157 <tr>
305 {%- set totalHits = country|sum(attribute='hits')|ensuremin(1) %} 158 <th bgcolor="#ECECEC">{{field.coltitle}}</th>
306 {%- set totalBandwidth = country|sum(attribute='bandwidth')|ensuremin(1) %} 159 <th bgcolor="#66DDEE" colspan="2">Hits</th>
307 {%- for info in country[0:10] %} 160 <th bgcolor="#2EA495" colspan="2">Bandwidth</th>
308 <tr> 161 </tr>
309 <td><div class="flag {{info.image}}"></div></td> 162 {%- for name, value in items[0:30] %}
310 <td>{{info.name}}</td> 163 {{row(name, value, params, special=name|isspecial(field))}}
311 <td>{{info.id}}</td> 164 {%- endfor %}
312 <td align="right">{{info.hits}}</td> 165 {%- if count > 30 %}
313 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td> 166 <tr id="{{field.name}}_showAll" class="special">
314 <td align="right">{{info.bandwidth|bytes}}</td> 167 <td>
315 <td class="chart"> 168 Other
316 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br /> 169 <a href="#" class="showAllLink" data-hide="{{field.name}}_showAl l" data-show="{{field.name}}_additionalItems">
317 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> 170 Show all
318 </td> 171 </a>
319 </tr> 172 </td>
320 {%- endfor %} 173 <td align="right">{{items[30:]|sumhits}}</td>
321 {%- if country|length > 10 %} 174 <td>&nbsp;</td>
322 <tr class="special" id="showothercountries"> 175 <td align="right">{{items[30:]|sumbandwidth|bytes}}</td>
323 <td>&nbsp;</td> 176 <td>&nbsp;</td>
324 <td> 177 <td>&nbsp;</td>
325 Other 178 </tr>
326 <a href="#" style="font-size: 80%;" onclick="getElementById('showoth ercountries').style.display='none';getElementById('othercountries').style.displa y='';return false;"> 179 <tbody id="{{field.name}}_additionalItems" style="display: none;">
327 Show all 180 {%- for name, value in items[30:] %}
328 </a> 181 {{row(name, value, params, special=name|isspecial(field),
329 </td> 182 filtered_url=filtered_urls.get(params.field.name, {}).get(name , None))}}
330 <td>&nbsp;</td> 183 {%- endfor %}
331 <td align="right">{{country[10:]|sum(attribute='hits')}}</td> 184 </tbody>
332 <td>&nbsp;</td> 185 {%- endif %}
333 <td align="right">{{country[10:]|sum(attribute='bandwidth')|bytes}}</t d> 186 {%- if field.showaverage %}
334 <td>&nbsp;</td> 187 {%- set avghits = (params.totalhits / count)|int %}
335 </tr> 188 {%- set avgbandwidth = (params.totalbandwidth / count)|int %}
336 <tbody id="othercountries" style="display: none;"> 189 {{row("Average", {"hits": avghits, "bandwidth": avgbandwidth}, par ams, special=True, emph=True)}}
337 {%- for info in country[10:] %} 190 {%- endif %}
338 <tr> 191 {%- if field.name == "day" and filterFields|length == 0 %}
339 <td><div class="flag {{info.image}}"></div></td> 192 {{row("Total", {"hits": params.totalhits, "bandwidth": params.tota lbandwidth}, params, special=True, emph=True, chart=False)}}
340 <td>{{info.name}}</td> 193 {%- endif %}
341 <td>{{info.id}}</td> 194 </table>
342 <td align="right">{{info.hits}}</td> 195 </div>
343 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1) }}%</td> 196 {%- endif %}
344 <td align="right">{{info.bandwidth|bytes}}</td> 197 {%- endfor %}
345 <td class="chart">
346 <div class="hitsChart horizontal" style="width: {{(info.hits / max Hits * 100)|round(method='ceil')|int}}px;"></div><br />
347 <div class="bandwidthChart horizontal" style="width: {{(info.bandw idth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
348 </td>
349 </tr>
350 {%- endfor %}
351 </tbody>
352 {%- endif %}
353 </table>
354 </div>
355
356 <div class="block_title">Download mirrors</div>
357 <div class="block">
358 <table align="center">
359 <tr>
360 <th bgcolor="#ECECEC">Mirror</th>
361 <th bgcolor="#66DDEE" colspan="2">Hits</th>
362 <th bgcolor="#2EA495">Bandwidth</th>
363 <th>&nbsp;</th>
364 </tr>
365 {%- set maxHits = mirror|max(attribute='hits')|ensuremin(1) %}
366 {%- set maxBandwidth = mirror|max(attribute='bandwidth')|ensuremin(1) %}
367 {%- set totalHits = mirror|sum(attribute='hits')|ensuremin(1) %}
368 {%- set totalBandwidth = mirror|sum(attribute='bandwidth')|ensuremin(1) %}
369 {%- for info in mirror %}
370 <tr>
371 <td>{{info.id}}</td>
372 <td align="right">{{info.hits}}</td>
373 <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}} %</td>
374 <td align="right">{{info.bandwidth|bytes}}</td>
375 <td class="chart">
376 <div class="hitsChart horizontal" style="width: {{(info.hits / maxHi ts * 100)|round(method='ceil')|int}}px;"></div><br />
377 <div class="bandwidthChart horizontal" style="width: {{(info.bandwid th / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div>
378 </td>
379 </tr>
380 {%- endfor %}
381 </table>
382 </div>
383 </body> 198 </body>
384 </html> 199 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld