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

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

Issue 6176591998615552: Fix handling of boolean keys (Closed)
Patch Set: Created Jan. 13, 2014, 7:12 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 | « no previous file | no next file » | 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-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
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 </td> 98 </td>
99 {%- else %} 99 {%- else %}
100 <td>&nbsp;</td> 100 <td>&nbsp;</td>
101 {%- endif %} 101 {%- endif %}
102 </tr> 102 </tr>
103 {%- endmacro %} 103 {%- endmacro %}
104 104
105 {# Using selectattr filter would be nice but servers don't have Jinja 2.7 ye t #} 105 {# Using selectattr filter would be nice but servers don't have Jinja 2.7 ye t #}
106 {%- set filterFields = [] %} 106 {%- set filterFields = [] %}
107 {%- for field in fields %} 107 {%- for field in fields %}
108 {%- if field.filter and field.name in data and "true" in data[field.name] %} 108 {%- if field.filter and field.name in data and "True" in data[field.name] %}
109 {%- set dummy = filterFields.append(field) %} 109 {%- set dummy = filterFields.append(field) %}
110 {%- endif %} 110 {%- endif %}
111 {%- endfor %} 111 {%- endfor %}
112 112
113 <div id="quickLinks"> 113 <div id="quickLinks">
114 {%- if filterFields|length > 0 %} 114 {%- if filterFields|length > 0 %}
115 <a href="#overview">Overview</a> 115 <a href="#overview">Overview</a>
116 {%- endif %} 116 {%- endif %}
117 117
118 {%- for field in fields %} 118 {%- for field in fields %}
(...skipping 12 matching lines...) Expand all
131 {%- endif %} 131 {%- endif %}
132 <div id="overview" class="block_title">Overview</div> 132 <div id="overview" class="block_title">Overview</div>
133 <div class="block"> 133 <div class="block">
134 <table align="center"> 134 <table align="center">
135 <tr> 135 <tr>
136 <th bgcolor="#ECECEC">Condition</th> 136 <th bgcolor="#ECECEC">Condition</th>
137 <th bgcolor="#66DDEE" colspan="2">Hits</th> 137 <th bgcolor="#66DDEE" colspan="2">Hits</th>
138 <th bgcolor="#2EA495" colspan="2">Bandwidth</th> 138 <th bgcolor="#2EA495" colspan="2">Bandwidth</th>
139 </tr> 139 </tr>
140 {%- for field in filterFields %} 140 {%- for field in filterFields %}
141 {{row(field.title, data[field.name].true, params, chart=False, 141 {{row(field.title, data[field.name].True, params, chart=False,
142 filtered_url=filtered_urls.get(field.name, {}).get("true", Non e))}} 142 filtered_url=filtered_urls.get(field.name, {}).get("True", Non e))}}
143 {%- endfor %} 143 {%- endfor %}
144 {{row("Total", {"hits": params.totalhits, "bandwidth": params.totalban dwidth}, params, special=True, emph=True, chart=False)}} 144 {{row("Total", {"hits": params.totalhits, "bandwidth": params.totalban dwidth}, params, special=True, emph=True, chart=False)}}
145 </table> 145 </table>
146 </div> 146 </div>
147 {%- endif %} 147 {%- endif %}
148 148
149 {%- for field in fields %} 149 {%- for field in fields %}
150 {%- if not field.filter and not field.hidden and field.name in data %} 150 {%- if not field.filter and not field.hidden and field.name in data %}
151 {%- set items = data[field.name]|sortfield(field) %} 151 {%- set items = data[field.name]|sortfield(field) %}
152 {%- set params = {"maxhits": items|maxhits, "maxbandwidth": items|maxban dwidth, 152 {%- set params = {"maxhits": items|maxhits, "maxbandwidth": items|maxban dwidth,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 {%- endif %} 193 {%- endif %}
194 {%- if field.name == "day" and filterFields|length == 0 %} 194 {%- if field.name == "day" and filterFields|length == 0 %}
195 {{row("Total", {"hits": params.totalhits, "bandwidth": params.tota lbandwidth}, params, special=True, emph=True, chart=False)}} 195 {{row("Total", {"hits": params.totalhits, "bandwidth": params.tota lbandwidth}, params, special=True, emph=True, chart=False)}}
196 {%- endif %} 196 {%- endif %}
197 </table> 197 </table>
198 </div> 198 </div>
199 {%- endif %} 199 {%- endif %}
200 {%- endfor %} 200 {%- endfor %}
201 </body> 201 </body>
202 </html> 202 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld