| Index: sitescripts/stats/template/fileStats.html |
| =================================================================== |
| rename from sitescripts/logs/template/subscription.html |
| rename to sitescripts/stats/template/fileStats.html |
| --- a/sitescripts/logs/template/subscription.html |
| +++ b/sitescripts/stats/template/fileStats.html |
| @@ -1,384 +1,199 @@ |
| -<!-- |
| - - 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" /> |
| - <link rel="stylesheet" type="text/css" href="static/flags.css" /> |
| - <link rel="stylesheet" type="text/css" href="static/hours.css" /> |
| - <title>Statistics for filter subscription {{fileName}} ({{month|monthname}})</title> |
| - </head> |
| - |
| - <body style="margin-top: 0px"> |
| - <a name="top"> </a> |
| - <table class="block" width="100%"> |
| - <tr> |
| - <td class="title" width="250">Statistics for subscription:</td> |
| - <td>easylist-downloads.adblockplus.org/{{fileName}}</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}} (<a href="{{overviewURL}}">To overview page</a>)</td> |
| - </tr> |
| - </table> |
| - |
| - <div class="block_title">Days of month</div> |
| - <div class="block"> |
| - <table align="center" style="margin-bottom: 20px;"> |
| - <tr align="bottom"> |
| - {%- set maxHits = day|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = day|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- set totalHits = day|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = day|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- set dayCount = day|length %} |
| - {%- if currentMonth and dayCount > 1 %} |
| - {%- set totalHits = totalHits - day[-1].hits %} |
| - {%- set totalBandwidth = totalBandwidth - day[-1].bandwidth %} |
| - {%- set dayCount = dayCount - 1 %} |
| - {%- endif %} |
| - {%- for info in day %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="height: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" title="Bandwidth: {{info.bandwidth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - {%- if loop.last and info.id|int < daysInMonth %} |
| - {%- for dummyDay in range(info.id|int + 1, daysInMonth + 1) %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: 0" style="height: 1px;"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" title="Bandwidth: 1" style="height: 1px;"></div> |
| - </td> |
| - {%- endfor %} |
| - {%- endif %} |
| - {%- endfor %} |
| - {%- set avgHits = (totalHits / dayCount)|int %} |
| - {%- set avgBandwidth = (totalBandwidth / dayCount)|int %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: {{avgHits}}" style="height: {{(avgHits / maxHits * 100)|round(method='ceil')|int}}px;"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" title="Bandwidth: {{avgBandwidth|bytes}}" style="height: {{(avgBandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - </tr> |
| - <tr> |
| - {%- for info in day %} |
| - <td align="center"{% if info.weekday > 4 %} class="special"{% endif %}> |
| - {{info.id}}<br /> |
| - {{month|monthname(format='%b')}} |
| - </td> |
| - {%- if loop.last and info.id|int < daysInMonth %} |
| - {%- for dummyDay in range(info.id|int + 1, daysInMonth + 1) %} |
| - <td align="center"> |
| - {{dummyDay}}<br /> |
| - {{month|monthname(format='%b')}} |
| - </td> |
| - {%- endfor %} |
| - {%- endif %} |
| - {%- endfor %} |
| - <td align="center"> |
| - Average |
| - </td> |
| - </tr> |
| - </table> |
| - |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC">Day</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - </tr> |
| - {%- for info in day %} |
| - <tr{% if info.weekday > 4 %} class="special"{% endif %}> |
| - <td>{{info.id}} {{month|monthname}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - </tr> |
| - {%- endfor %} |
| - <tr class="special"> |
| - <td style="font-weight: bold">Average</td> |
| - <td align="right">{{avgHits}}</td> |
| - <td align="right"> </td> |
| - <td align="right">{{avgBandwidth|bytes}}</td> |
| - </tr> |
| - <tr class="special"> |
| - <td style="font-weight: bold">Total</td> |
| - <td align="right">{{totalHits}}</td> |
| - <td align="right"> </td> |
| - <td align="right">{{totalBandwidth|bytes}}</td> |
| - </tr> |
| - </table> |
| - </div> |
| - |
| - <div class="block_title">Days of week</div> |
| - <div class="block"> |
| - <table align="center" style="margin-bottom: 20px;"> |
| - <tr align="bottom"> |
| - {%- set maxHits = weekday|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = weekday|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in weekday %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="height: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" alt="Bandwidth: {{info.bandwidth|bytes}}"" title="Bandwidth: {{info.bandwidth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px"></div> |
| - </td> |
| - {%- endfor %} |
| - </tr> |
| - <tr> |
| - {%- for info in weekday %} |
| - <td align="center"{% if info.id > 4 %} class="special"{% endif %}> |
| - {{info.id|weekday}} |
| - </td> |
| - {%- endfor %} |
| - </tr> |
| - </table> |
| - |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC">Day</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - </tr> |
| - {%- set totalHits = weekday|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = weekday|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in weekday %} |
| - <tr{% if info.id > 4 %} class="special"{% endif %}> |
| - <td>{{info.id|weekday}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - </tr> |
| - {%- endfor %} |
| - </table> |
| - </div> |
| - |
| - <div class="block_title">Hours</div> |
| - <div class="block"> |
| - <table align="center" style="margin-bottom: 20px;"> |
| - <tr align="bottom"> |
| - {%- set maxHits = hour|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = hour|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in hour %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: {{info.hits}}" style="height: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" title="Bandwidth: {{info.bandwidth|bytes}}" style="height: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - {%- if loop.last and info.id|int < 23 %} |
| - {%- for dummyHour in range(info.id|int + 1, 24) %} |
| - <td align="center" style="vertical-align: bottom;"> |
| - <div class="hitsChart vertical" title="Hits: 0" style="height: 1px;"></div> |
| - {{- '' -}} |
| - <div class="bandwidthChart vertical" title="Bandwidth: 0" style="height: 1px;"></div> |
| - </td> |
| - {%- endfor %} |
| - {%- endif %} |
| - {%- endfor %} |
| - </tr> |
| - <tr> |
| - {%- for info in hour %} |
| - <td align="center"> |
| - {{info.id}}<br /> |
| - <div class="hour hour{{info.id|int % 12 + 1}}" ></div> |
| - </td> |
| - {%- if loop.last and info.id|int < 23 %} |
| - {%- for dummyHour in range(info.id|int + 1, 24) %} |
| - <td align="center"> |
| - {{dummyHour}}<br /> |
| - <div class="hour hour{{dummyHour % 12 + 1}}" ></div> |
| - </td> |
| - {%- endfor %} |
| - {%- endif %} |
| - {%- endfor %} |
| - </tr> |
| - </table> |
| - |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC">Hour</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - </tr> |
| - {%- set totalHits = hour|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = hour|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in hour %} |
| - <tr> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - </tr> |
| - {%- endfor %} |
| - </table> |
| - </div> |
| - |
| - {%- if app %} |
| - <div class="block_title">Browsers</div> |
| - <div class="block"> |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC">Browser</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - </tr> |
| - {%- set maxHits = app|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = app|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- set totalHits = app|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = app|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in app[0:10] %} |
| - <tr> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - <td class="chart"> |
| - <div class="hitsChart horizontal" style="width: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| - <div class="bandwidthChart horizontal" style="width: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - </tr> |
| - {%- endfor %} |
| - {%- if app|length > 10 %} |
| - <tr class="special" id="showotherapps"> |
| - <td> |
| - Other |
| - <a href="#" style="font-size: 80%;" onclick="getElementById('showotherapps').style.display='none';getElementById('otherapps').style.display='';return false;"> |
| - Show all |
| - </a> |
| - </td> |
| - <td align="right">{{app[10:]|sum(attribute='hits')}}</td> |
| - <td> </td> |
| - <td align="right">{{app[10:]|sum(attribute='bandwidth')|bytes}}</td> |
| - <td> </td> |
| - </tr> |
| - <tbody id="otherapps" style="display: none;"> |
| - {%- for info in app[10:] %} |
| - <tr> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - <td class="chart"> |
| - <div class="hitsChart horizontal" style="width: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| - <div class="bandwidthChart horizontal" style="width: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - </tr> |
| - {%- endfor %} |
| - </tbody> |
| - {%- endif %} |
| - </table> |
| - </div> |
| - {%- endif %} |
| - |
| - <div class="block_title">Countries</div> |
| - <div class="block"> |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC" colspan="3">Country</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - <th> </th> |
| - </tr> |
| - {%- set maxHits = country|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = country|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- set totalHits = country|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = country|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in country[0:10] %} |
| - <tr> |
| - <td><div class="flag {{info.image}}"></div></td> |
| - <td>{{info.name}}</td> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - <td class="chart"> |
| - <div class="hitsChart horizontal" style="width: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| - <div class="bandwidthChart horizontal" style="width: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - </tr> |
| - {%- endfor %} |
| - {%- if country|length > 10 %} |
| - <tr class="special" id="showothercountries"> |
| - <td> </td> |
| - <td> |
| - Other |
| - <a href="#" style="font-size: 80%;" onclick="getElementById('showothercountries').style.display='none';getElementById('othercountries').style.display='';return false;"> |
| - Show all |
| - </a> |
| - </td> |
| - <td> </td> |
| - <td align="right">{{country[10:]|sum(attribute='hits')}}</td> |
| - <td> </td> |
| - <td align="right">{{country[10:]|sum(attribute='bandwidth')|bytes}}</td> |
| - <td> </td> |
| - </tr> |
| - <tbody id="othercountries" style="display: none;"> |
| - {%- for info in country[10:] %} |
| - <tr> |
| - <td><div class="flag {{info.image}}"></div></td> |
| - <td>{{info.name}}</td> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - <td class="chart"> |
| - <div class="hitsChart horizontal" style="width: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| - <div class="bandwidthChart horizontal" style="width: {{(info.bandwidth / maxBandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| - </td> |
| - </tr> |
| - {%- endfor %} |
| - </tbody> |
| - {%- endif %} |
| - </table> |
| - </div> |
| - |
| - <div class="block_title">Download mirrors</div> |
| - <div class="block"> |
| - <table align="center"> |
| - <tr> |
| - <th bgcolor="#ECECEC">Mirror</th> |
| - <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| - <th bgcolor="#2EA495">Bandwidth</th> |
| - <th> </th> |
| - </tr> |
| - {%- set maxHits = mirror|max(attribute='hits')|ensuremin(1) %} |
| - {%- set maxBandwidth = mirror|max(attribute='bandwidth')|ensuremin(1) %} |
| - {%- set totalHits = mirror|sum(attribute='hits')|ensuremin(1) %} |
| - {%- set totalBandwidth = mirror|sum(attribute='bandwidth')|ensuremin(1) %} |
| - {%- for info in mirror %} |
| - <tr> |
| - <td>{{info.id}}</td> |
| - <td align="right">{{info.hits}}</td> |
| - <td align="right">{{(info.hits / totalHits * 100)|round(precision=1)}}%</td> |
| - <td align="right">{{info.bandwidth|bytes}}</td> |
| - <td class="chart"> |
| - <div class="hitsChart horizontal" style="width: {{(info.hits / maxHits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| - <div class="bandwidthChart horizontal" style="width: {{(info.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" /> |
| + <link rel="stylesheet" type="text/css" href="../../../static/flags.css" /> |
| + <link rel="stylesheet" type="text/css" href="../../../static/hours.css" /> |
| + <title>Statistics for file {{fileName}} ({{month|monthname}})</title> |
| + <script type="text/javascript"> |
| + document.addEventListener("click", function(event) |
| + { |
| + if (event.target.className == "showAllLink") |
| + { |
| + document.getElementById(event.target.getAttribute("data-hide")).style.display = "none"; |
| + document.getElementById(event.target.getAttribute("data-show")).style.display = ""; |
| + event.preventDefault(); |
| + } |
| + }, false); |
| + </script> |
| + </head> |
| + |
| + <body style="margin-top: 0px"> |
| + <a name="top"> </a> |
| + <table class="block" width="100%"> |
| + <tr> |
| + <td class="title" width="250">Statistics for file:</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}} (<a href="{{overview_url}}">To overview page</a>)</td> |
| + </tr> |
| + {%- if filter %} |
| + <tr> |
| + <td class="title" width="250">Filter:</td> |
| + <td> |
| + {%- if filter.field.filter %} |
| + {{filter.field.title}} only |
| + {%- else %} |
| + {{filter.field.coltitle}} is {{filter.value}} |
| + {%- endif %} |
| + (<a href="index.html">Remove filter</a>)</td> |
| + </tr> |
| + {%- endif %} |
| + </table> |
| + |
| + {%- macro row(name, value, params, special=False, emph=False, chart=True, filtered_url=None) %} |
| + <tr{% if special %} class="special"{% endif%}> |
| + <td{% if emph %} class="emph"{% endif%}> |
| + {%- if filtered_url %} |
| + <a href="{{filtered_url}}"> |
| + {%- endif %} |
| + |
| + {%- if not special and params.field.name == "hour" -%} |
| + <div class="hour hour{{name|int % 12 + 1}}"></div> {{name}} |
| + {%- elif not special and params.field.name == "country" -%} |
| + <div class="flag {{name}}"></div> {{name|countryname}} <div class="countrycode">{{name}}</div> |
| + {%- else -%} |
| + {{name}} |
| + {%- endif -%} |
| + |
| + {%- if filtered_url %} |
| + </a> |
| + {%- endif %} |
| + </td> |
| + <td align="right">{{value.hits}}</td> |
| + <td align="right">{{(value.hits / params.totalhits * 100)|round(precision=1)}}%</td> |
| + <td align="right">{{value.bandwidth|bytes}}</td> |
| + <td align="right">{{(value.bandwidth / params.totalbandwidth * 100)|round(precision=1)}}%</td> |
| + {%- if chart %} |
| + <td class="chart"> |
| + <div class="hitsChart" style="width: {{(value.hits / params.maxhits * 100)|round(method='ceil')|int}}px;"></div><br /> |
| + <div class="bandwidthChart" style="width: {{(value.bandwidth / params.maxbandwidth * 100)|round(method='ceil')|int}}px;"></div> |
| + </td> |
| + {%- else %} |
| + <td> </td> |
| + {%- endif %} |
| + </tr> |
| + {%- endmacro %} |
| + |
| + {# Using selectattr filter would be nice but servers don't have Jinja 2.7 yet #} |
| + {%- set filterFields = [] %} |
| + {%- for field in fields %} |
| + {%- if field.filter and field.name in data and "true" in data[field.name] %} |
| + {%- set dummy = filterFields.append(field) %} |
| + {%- endif %} |
| + {%- endfor %} |
| + |
| + <div id="quickLinks"> |
| + {%- if filterFields|length > 0 %} |
| + <a href="#overview">Overview</a> |
| + {%- endif %} |
| + |
| + {%- for field in fields %} |
| + {%- if not field.filter and field.name in data %} |
| + <a href="#{{field.name}}">{{field.title}}</a> |
| + {%- endif %} |
| + {%- endfor %} |
| + </div> |
| + |
| + {%- if filterFields|length > 0 %} |
| + {%- if filter %} |
| + {%- set params = {"totalhits": data.hits, "totalbandwidth": data.bandwidth, "field": {"name": None}} %} |
| + {%- else %} |
| + {%- set items = data.day|sortfield("day") %} |
| + {%- set params = {"totalhits": items|sumhits, "totalbandwidth": items|sumbandwidth, "field": {"name": None}} %} |
| + {%- endif %} |
| + <div id="overview" class="block_title">Overview</div> |
| + <div class="block"> |
| + <table align="center"> |
| + <tr> |
| + <th bgcolor="#ECECEC">Condition</th> |
| + <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| + <th bgcolor="#2EA495" colspan="2">Bandwidth</th> |
| + </tr> |
| + {%- for field in filterFields %} |
| + {{row(field.title, data[field.name].true, params, chart=False, |
| + filtered_url=filtered_urls.get(field.name, {}).get("true", None))}} |
| + {%- endfor %} |
| + {{row("Total", {"hits": params.totalhits, "bandwidth": params.totalbandwidth}, params, special=True, emph=True, chart=False)}} |
| + </table> |
| + </div> |
| + {%- endif %} |
| + |
| + {%- for field in fields %} |
| + {%- if not field.filter and field.name in data %} |
| + {%- set items = data[field.name]|sortfield(field) %} |
| + {%- set params = {"maxhits": items|maxhits, "maxbandwidth": items|maxbandwidth, |
| + "totalhits": items|sumhits, "totalbandwidth": items|sumbandwidth, |
| + "field": field} %} |
| + {%- set count = items|length %} |
| + <div id="{{field.name}}" class="block_title">{{field.title}}</div> |
| + <div class="block"> |
| + <table align="center"> |
| + <tr> |
| + <th bgcolor="#ECECEC">{{field.coltitle}}</th> |
| + <th bgcolor="#66DDEE" colspan="2">Hits</th> |
| + <th bgcolor="#2EA495" colspan="2">Bandwidth</th> |
| + </tr> |
| + {%- for name, value in items[0:30] %} |
| + {{row(name, value, params, special=name|isspecial(field))}} |
| + {%- endfor %} |
| + {%- if count > 30 %} |
| + <tr id="{{field.name}}_showAll" class="special"> |
| + <td> |
| + Other |
| + <a href="#" class="showAllLink" data-hide="{{field.name}}_showAll" data-show="{{field.name}}_additionalItems"> |
| + Show all |
| + </a> |
| + </td> |
| + <td align="right">{{items[30:]|sumhits}}</td> |
| + <td> </td> |
| + <td align="right">{{items[30:]|sumbandwidth|bytes}}</td> |
| + <td> </td> |
| + <td> </td> |
| + </tr> |
| + <tbody id="{{field.name}}_additionalItems" style="display: none;"> |
| + {%- for name, value in items[30:] %} |
| + {{row(name, value, params, special=name|isspecial(field), |
| + filtered_url=filtered_urls.get(params.field.name, {}).get(name, None))}} |
| + {%- endfor %} |
| + </tbody> |
| + {%- endif %} |
| + {%- if field.showaverage %} |
| + {%- set avghits = (params.totalhits / count)|int %} |
| + {%- set avgbandwidth = (params.totalbandwidth / count)|int %} |
| + {{row("Average", {"hits": avghits, "bandwidth": avgbandwidth}, params, special=True, emph=True)}} |
| + {%- endif %} |
| + {%- if field.name == "day" and filterFields|length == 0 %} |
| + {{row("Total", {"hits": params.totalhits, "bandwidth": params.totalbandwidth}, params, special=True, emph=True, chart=False)}} |
| + {%- endif %} |
| + </table> |
| + </div> |
| + {%- endif %} |
| + {%- endfor %} |
| + </body> |
| +</html> |