Merge lp:~brian-murray/arsenal/most-duplicates into lp:~bryce/arsenal/2.x
- most-duplicates
- Merge into 2.x
Proposed by
Brian Murray
Status: | Merged |
---|---|
Merge reported by: | Bryce Harrington |
Merged at revision: | not available |
Proposed branch: | lp:~brian-murray/arsenal/most-duplicates |
Merge into: | lp:~bryce/arsenal/2.x |
Diff against target: |
681 lines (+638/-4) 4 files modified
reports/most-dupes/most-dupes.json (+34/-0) scripts/collect-bug-data (+20/-3) scripts/reporter (+1/-1) web/templates/bugs-by-team-dupe-count.mako (+583/-0) |
To merge this branch: | bzr merge lp:~brian-murray/arsenal/most-duplicates |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bryce Harrington | Approve | ||
Review via email: mp+106051@code.launchpad.net |
Commit message
Description of the change
add in a json file for most-dupes and a new template file that will show the dupe count
additionally and in some more parameters to collect-bug-data to utilize order_by in searchTasks and limit the quantity so you could get the 50 newest bugs or the 100 bugs with the most duplicates.
To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'reports/most-dupes' | |||
2 | === added file 'reports/most-dupes/most-dupes.json' | |||
3 | --- reports/most-dupes/most-dupes.json 1970-01-01 00:00:00 +0000 | |||
4 | +++ reports/most-dupes/most-dupes.json 2012-05-16 20:40:24 +0000 | |||
5 | @@ -0,0 +1,34 @@ | |||
6 | 1 | { | ||
7 | 2 | "launchpad_config": { | ||
8 | 3 | "launchpad_client_name": "rls-mgr-reports", | ||
9 | 4 | "read_only": false | ||
10 | 5 | }, | ||
11 | 6 | "search_criteria": [ | ||
12 | 7 | { | ||
13 | 8 | "distribution": "ubuntu", | ||
14 | 9 | "limit": 50, | ||
15 | 10 | "order_by": "-number_of_duplicates", | ||
16 | 11 | "series": [ | ||
17 | 12 | "precise", | ||
18 | 13 | "NONE" | ||
19 | 14 | ], | ||
20 | 15 | "status": [ | ||
21 | 16 | "New", | ||
22 | 17 | "Confirmed", | ||
23 | 18 | "Triaged", | ||
24 | 19 | "Incomplete", | ||
25 | 20 | "Incomplete (with response)", | ||
26 | 21 | "Incomplete (without response)", | ||
27 | 22 | "In Progress", | ||
28 | 23 | "Fix Committed" | ||
29 | 24 | ], | ||
30 | 25 | "tags": [ | ||
31 | 26 | "precise" | ||
32 | 27 | ] | ||
33 | 28 | } | ||
34 | 29 | ], | ||
35 | 30 | "report": { | ||
36 | 31 | "show_total_bugs": true, | ||
37 | 32 | "title": "" | ||
38 | 33 | } | ||
39 | 34 | } | ||
40 | 0 | 35 | ||
41 | === modified file 'scripts/collect-bug-data' | |||
42 | --- scripts/collect-bug-data 2012-05-02 19:22:01 +0000 | |||
43 | +++ scripts/collect-bug-data 2012-05-16 20:40:24 +0000 | |||
44 | @@ -307,6 +307,16 @@ | |||
45 | 307 | Dbg.verbose('search: status: \'%s\'\n' % ','.join(search_status)) | 307 | Dbg.verbose('search: status: \'%s\'\n' % ','.join(search_status)) |
46 | 308 | 308 | ||
47 | 309 | try: | 309 | try: |
48 | 310 | search_order = search_criteria['order_by'] | ||
49 | 311 | except KeyError: | ||
50 | 312 | search_order = '' | ||
51 | 313 | |||
52 | 314 | try: | ||
53 | 315 | search_limit = search_criteria['limit'] | ||
54 | 316 | except KeyError: | ||
55 | 317 | search_limit = '' | ||
56 | 318 | |||
57 | 319 | try: | ||
58 | 310 | reporters = search_criteria['reporters'] | 320 | reporters = search_criteria['reporters'] |
59 | 311 | except KeyError: | 321 | except KeyError: |
60 | 312 | reporters = '' | 322 | reporters = '' |
61 | @@ -394,9 +404,16 @@ | |||
62 | 394 | tasks.append(task) | 404 | tasks.append(task) |
63 | 395 | return tasks | 405 | return tasks |
64 | 396 | else: | 406 | else: |
68 | 397 | return distro.search_tasks(tags=search_tags, | 407 | if search_limit == '': |
69 | 398 | tags_combinator=search_tags_combinator, status=search_status, | 408 | return distro.search_tasks(tags=search_tags, |
70 | 399 | modified_since=last_run_time) | 409 | tags_combinator=search_tags_combinator, |
71 | 410 | status=search_status, modified_since=last_run_time, | ||
72 | 411 | order_by=search_order) | ||
73 | 412 | else: | ||
74 | 413 | return distro.search_tasks(tags=search_tags, | ||
75 | 414 | tags_combinator=search_tags_combinator, | ||
76 | 415 | status=search_status, modified_since=last_run_time, | ||
77 | 416 | order_by=search_order)[:search_limit] | ||
78 | 400 | 417 | ||
79 | 401 | # main | 418 | # main |
80 | 402 | # | 419 | # |
81 | 403 | 420 | ||
82 | === modified file 'scripts/reporter' | |||
83 | --- scripts/reporter 2012-03-27 03:38:34 +0000 | |||
84 | +++ scripts/reporter 2012-05-16 20:40:24 +0000 | |||
85 | @@ -239,7 +239,7 @@ | |||
86 | 239 | for bug_task in bd['tasks'][bid]: | 239 | for bug_task in bd['tasks'][bid]: |
87 | 240 | task = {} | 240 | task = {} |
88 | 241 | task['bug'] = {} | 241 | task['bug'] = {} |
90 | 242 | for k in ['title', 'series_name', 'number_of_messages', 'number_subscribed', 'number_affected', 'iso_date_created', 'last_update', 'series_version']: | 242 | for k in ['title', 'series_name', 'number_of_messages', 'number_subscribed', 'number_affected', 'iso_date_created', 'last_update', 'series_version', 'number_of_duplicates']: |
91 | 243 | # in the event that a key doesn't exist in the json file set it to '' | 243 | # in the event that a key doesn't exist in the json file set it to '' |
92 | 244 | try: | 244 | try: |
93 | 245 | task['bug'][k] = bug_task['bug'][k] | 245 | task['bug'][k] = bug_task['bug'][k] |
94 | 246 | 246 | ||
95 | === added file 'web/templates/bugs-by-team-dupe-count.mako' | |||
96 | --- web/templates/bugs-by-team-dupe-count.mako 1970-01-01 00:00:00 +0000 | |||
97 | +++ web/templates/bugs-by-team-dupe-count.mako 2012-05-16 20:40:24 +0000 | |||
98 | @@ -0,0 +1,583 @@ | |||
99 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
100 | 2 | <% | ||
101 | 3 | importance_color = { | ||
102 | 4 | "Unknown" : "importance-unknown", | ||
103 | 5 | "Critical" : "importance-critical", | ||
104 | 6 | "High" : "importance-high", | ||
105 | 7 | "Medium" : "importance-medium", | ||
106 | 8 | "Low" : "importance-low", | ||
107 | 9 | "Wishlist" : "importance-wishlist", | ||
108 | 10 | "Undecided" : "importance-undecided" | ||
109 | 11 | } | ||
110 | 12 | status_color = { | ||
111 | 13 | "New" : "status-new", | ||
112 | 14 | "Incomplete" : "status-incomplete", | ||
113 | 15 | "Confirmed" : "status-confirmed", | ||
114 | 16 | "Triaged" : "status-triaged", | ||
115 | 17 | "In Progress" : "status-in_progress", | ||
116 | 18 | "Fix Committed" : "status-fix_committed", | ||
117 | 19 | "Fix Released" : "status-fix_released", | ||
118 | 20 | "Invalid" : "status-invalid", | ||
119 | 21 | "Won't Fix" : "status-wont_fix", | ||
120 | 22 | "Opinion" : "status-opinion", | ||
121 | 23 | "Expired" : "status-expired", | ||
122 | 24 | "Unknown" : "status-unknown" | ||
123 | 25 | } | ||
124 | 26 | |||
125 | 27 | bugs_by_team = {} | ||
126 | 28 | tasks = template_data['tasks'] | ||
127 | 29 | for bid in tasks: | ||
128 | 30 | for t in tasks[bid]: | ||
129 | 31 | team = 'unknown' if t['team'] == '' else t['team'] | ||
130 | 32 | |||
131 | 33 | if team not in bugs_by_team: | ||
132 | 34 | bugs_by_team[team] = {} | ||
133 | 35 | |||
134 | 36 | if bid not in bugs_by_team[team]: | ||
135 | 37 | bugs_by_team[team][bid] = [] | ||
136 | 38 | |||
137 | 39 | if t['bug_target_name'] not in bugs_by_team[team][bid]: | ||
138 | 40 | bugs_by_team[team][bid].append(t['bug_target_name']) | ||
139 | 41 | |||
140 | 42 | team_report_order = [] | ||
141 | 43 | if 'unknown' in bugs_by_team: | ||
142 | 44 | team_report_order.append('unknown') # We want unknown first | ||
143 | 45 | for t in sorted(bugs_by_team): | ||
144 | 46 | if t != 'unknown': | ||
145 | 47 | team_report_order.append(t) | ||
146 | 48 | |||
147 | 49 | report_options = template_data['report'] | ||
148 | 50 | %> | ||
149 | 51 | <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> | ||
150 | 52 | <head> | ||
151 | 53 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
152 | 54 | <title>${report_title}</title> | ||
153 | 55 | |||
154 | 56 | <link title="light" rel="stylesheet" href="http://people.canonical.com/~kernel/reports/css/light-style.css" type="text/css" media="print, projection, screen" /> | ||
155 | 57 | <link title="dark" rel="stylesheet" href="http://people.canonical.com/~kernel/reports/css/dark-style.css" type="text/css" media="print, projection, screen" /> | ||
156 | 58 | |||
157 | 59 | <script type="text/javascript" src="http://people.canonical.com/~kernel/reports/js/styleswitcher.js"></script> | ||
158 | 60 | |||
159 | 61 | <link href='http://fonts.googleapis.com/css?family=Cantarell&subset=latin' rel='stylesheet' type='text/css'> | ||
160 | 62 | <script type="text/javascript" src="http://people.canonical.com/~kernel/reports/js/jquery-latest.js"></script> | ||
161 | 63 | <script type="text/javascript" src="http://people.canonical.com/~kernel/reports/js/jquery.tablesorter.js"></script> | ||
162 | 64 | |||
163 | 65 | </head> | ||
164 | 66 | |||
165 | 67 | |||
166 | 68 | <body class="bugbody"> | ||
167 | 69 | <!-- Top Panel --> | ||
168 | 70 | <div id="toppanel"> | ||
169 | 71 | <!-- Sliding Panel | ||
170 | 72 | --> | ||
171 | 73 | <div id="panel"> | ||
172 | 74 | <form name="filter"> | ||
173 | 75 | <div class="content clearfix"> | ||
174 | 76 | |||
175 | 77 | <table width="100%"> | ||
176 | 78 | <tr valign="top"> | ||
177 | 79 | <td valign="top" width="30%"> | ||
178 | 80 | <p class="l2-section-heading">Importance</p> | ||
179 | 81 | <table width="100%"> | ||
180 | 82 | <tr><td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="Critical" /> Critical </td> | ||
181 | 83 | <td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="Low" /> Low </td></tr> | ||
182 | 84 | <tr><td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="High" /> High </td> | ||
183 | 85 | <td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="Wishlist" /> Wishlist </td></tr> | ||
184 | 86 | <tr><td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="Medium" /> Medium </td> | ||
185 | 87 | <td width="50%"> <input type="checkbox" name="importance" onclick="importance_handler(this, 'importance', true)" checked value="Undecided" /> Undecided </td></tr> | ||
186 | 88 | </table> | ||
187 | 89 | </td> | ||
188 | 90 | |||
189 | 91 | <td width="20"> </td> | ||
190 | 92 | |||
191 | 93 | <td valign="top"> | ||
192 | 94 | <p class="l2-section-heading">Status</p> | ||
193 | 95 | <table width="100%"> | ||
194 | 96 | <tr><td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="New" /> New </td> | ||
195 | 97 | <td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Incomplete" /> Incomplete </td></tr> | ||
196 | 98 | <tr><td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Confirmed" /> Confirmed </td> | ||
197 | 99 | <td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Fix Released" /> Fix Released </td></tr> | ||
198 | 100 | <tr><td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Triaged" /> Triaged </td> | ||
199 | 101 | <td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Won't Fix" /> Won't Fix </td></tr> | ||
200 | 102 | <tr><td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="In Progress" /> In Progress </td> | ||
201 | 103 | <td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Opinion" /> Opinion </td></tr> | ||
202 | 104 | <tr><td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Fix Committed" /> Fix Committed </td> | ||
203 | 105 | <td width="50%"> <input type="checkbox" name="status" onclick="status_handler(this, 'status', true)" checked value="Invalid" /> Invalid </td></tr> | ||
204 | 106 | </table> | ||
205 | 107 | </td> | ||
206 | 108 | |||
207 | 109 | <td width="20"> </td> | ||
208 | 110 | |||
209 | 111 | <td valign="top" width="30%"> | ||
210 | 112 | <p class="l2-section-heading">Series</p> | ||
211 | 113 | <table width="100%"> | ||
212 | 114 | <tr><td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="precise" /> Precise </td> | ||
213 | 115 | <td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="jaunty" /> Jaunty </td></tr> | ||
214 | 116 | <tr><td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="oneiric" /> Oneiric </td> | ||
215 | 117 | <td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="karmic" /> Karmic </td></tr> | ||
216 | 118 | <tr><td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="natty" /> Natty </td> | ||
217 | 119 | <td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="hardy" /> Hardy </td></tr> | ||
218 | 120 | <tr><td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="maverick" /> Maverick </td> | ||
219 | 121 | <td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="" /> Unknown </td></tr> | ||
220 | 122 | <tr><td width="50%"> <input type="checkbox" name="series" onclick="series_handler(this, 'series', true)" checked value="lucid" /> Lucid </td></tr> | ||
221 | 123 | </table> | ||
222 | 124 | </td> | ||
223 | 125 | |||
224 | 126 | </tr> | ||
225 | 127 | |||
226 | 128 | <!-- | ||
227 | 129 | <tr valign="top"> | ||
228 | 130 | |||
229 | 131 | <td valign="top" width="30%" colspan="5"> | ||
230 | 132 | <p class="l2-section-heading">Assignee</p> | ||
231 | 133 | <table width="100%"> | ||
232 | 134 | % for i, elem in enumerate(assignees_list): | ||
233 | 135 | % if i % 5 == 0: | ||
234 | 136 | <tr> | ||
235 | 137 | % endif | ||
236 | 138 | <td width="20%"> <input type="checkbox" name="assignees" onclick="assignee_handler(this, 'series', true)" checked value="${assignees_list[i]}" /> ${assignees_list[i]} </td> | ||
237 | 139 | % if i % 5 == 4: | ||
238 | 140 | </tr> | ||
239 | 141 | % endif | ||
240 | 142 | % endfor | ||
241 | 143 | </table> | ||
242 | 144 | </td> | ||
243 | 145 | </tr> | ||
244 | 146 | |||
245 | 147 | <tr valign="top"> | ||
246 | 148 | |||
247 | 149 | <td valign="top"> | ||
248 | 150 | <p class="l2-section-heading">Date</p> | ||
249 | 151 | <table width="100%"> | ||
250 | 152 | <tr><td colspan="4">Created within:</td></tr> | ||
251 | 153 | <tr><td width="10"> </td> | ||
252 | 154 | <td width="50"> <input type="radio" name="date" onclick="date_handler(this, 'date', true)" checked value="1" /> 24 Hrs. </td> | ||
253 | 155 | <td width="50"> <input type="radio" name="date" onclick="date_handler(this, 'date', true)" checked value="7" /> 1 Week </td> | ||
254 | 156 | <td width="50"> <input type="radio" name="date" onclick="date_handler(this, 'date', true)" checked value="30" /> 1 Month </td></tr> | ||
255 | 157 | <tr><td width="10"> </td> | ||
256 | 158 | <td width="50"> <input type="radio" name="date" onclick="date_handler(this, 'date', true)" checked value="-1" /> Unlimited </td></tr> | ||
257 | 159 | </table> | ||
258 | 160 | </td> | ||
259 | 161 | |||
260 | 162 | <td width="20"> </td> | ||
261 | 163 | |||
262 | 164 | <td valign="top"> | ||
263 | 165 | | ||
264 | 166 | </td> | ||
265 | 167 | |||
266 | 168 | <td width="20"> </td> | ||
267 | 169 | |||
268 | 170 | <td valign="top"> | ||
269 | 171 | | ||
270 | 172 | </td> | ||
271 | 173 | </tr> | ||
272 | 174 | --> | ||
273 | 175 | |||
274 | 176 | </table> | ||
275 | 177 | |||
276 | 178 | </div> | ||
277 | 179 | </form> | ||
278 | 180 | |||
279 | 181 | <div style="clear:both;"></div> | ||
280 | 182 | </div> <!-- panel --> | ||
281 | 183 | |||
282 | 184 | <!-- The tab on top --> | ||
283 | 185 | <div class="tab"> | ||
284 | 186 | <ul class="login"> | ||
285 | 187 | <li class="left"> </li> | ||
286 | 188 | <li id="toggle"> | ||
287 | 189 | <a id="open" class="open" href="#"> Options</a> | ||
288 | 190 | <a id="close" style="display: none;" class="close" href="#"> Close </a> | ||
289 | 191 | </li> | ||
290 | 192 | <li class="right"> </li> | ||
291 | 193 | </ul> | ||
292 | 194 | </div> <!-- / top --> | ||
293 | 195 | </div> <!-- Top Panel --> | ||
294 | 196 | |||
295 | 197 | <div class="outermost"> | ||
296 | 198 | <div class="title"> | ||
297 | 199 | ${report_title} | ||
298 | 200 | </div> | ||
299 | 201 | <div class="section"> | ||
300 | 202 | % for team in team_report_order: | ||
301 | 203 | % if 'show_total_bugs_per_team' in report_options and report_options['show_total_bugs_per_team']: | ||
302 | 204 | <% total = len(bugs_by_team[team].keys()) %> | ||
303 | 205 | <div class="section-heading">${team} (<span id="${team}-total">${total}</span>)</div> | ||
304 | 206 | % else: | ||
305 | 207 | <div class="section-heading">${team}</div> | ||
306 | 208 | % endif | ||
307 | 209 | |||
308 | 210 | <% id = team.replace(' ', '_') %> | ||
309 | 211 | <table id="${id}" class="tablesorter" border="0" cellpadding="0" cellspacing="1" width="100%%"> | ||
310 | 212 | <thead> | ||
311 | 213 | <tr> | ||
312 | 214 | <th width="40">Bug</th> | ||
313 | 215 | <th>Summary</th> | ||
314 | 216 | <th width="100">Package</th> | ||
315 | 217 | <th width="80">Importance</th> | ||
316 | 218 | <th width="80">Status</th> | ||
317 | 219 | <th width="140">Assignee</th> | ||
318 | 220 | <th width="60">Found</th> | ||
319 | 221 | <th width="60">Target</th> | ||
320 | 222 | <th width="100">Duplicates</th> | ||
321 | 223 | </tr> | ||
322 | 224 | </thead> | ||
323 | 225 | <tbody> | ||
324 | 226 | </tbody> | ||
325 | 227 | </table> | ||
326 | 228 | % endfor | ||
327 | 229 | |||
328 | 230 | </div> | ||
329 | 231 | <br /> | ||
330 | 232 | <br /> | ||
331 | 233 | <div> | ||
332 | 234 | % if 'show_total_bugs' in report_options and report_options['show_total_bugs']: | ||
333 | 235 | <div id="bug-total">Total: 000</div> | ||
334 | 236 | % endif | ||
335 | 237 | |||
336 | 238 | </div> | ||
337 | 239 | <div> | ||
338 | 240 | <br /> | ||
339 | 241 | <hr /> | ||
340 | 242 | <table width="100%%" cellspacing="0" cellpadding="0"> | ||
341 | 243 | <thead> | ||
342 | 244 | <tr> | ||
343 | 245 | <td width="100">Column</td> | ||
344 | 246 | <td>Description</td> | ||
345 | 247 | </tr> | ||
346 | 248 | </th> | ||
347 | 249 | <tbody> | ||
348 | 250 | <tr><td>Bug </td><td>The Launchpad Bug number and a link the the Launchpad Bug. </td></tr> | ||
349 | 251 | <tr><td>Summary </td><td>The 'summary' or 'title' from the bug. </td></tr> | ||
350 | 252 | <tr><td>Package </td><td>The package a bug task was created for relating to the specific bug. </td></tr> | ||
351 | 253 | <tr><td>Importance</td><td>The bug task's importance. </td></tr> | ||
352 | 254 | <tr><td>Status </td><td>The bug task's status. </td></tr> | ||
353 | 255 | <tr><td>Assignee </td><td>The person or team assigned to work on the bug. </td></tr> | ||
354 | 256 | <tr><td>Found </td><td>The milestone during which the bug was found. </td></tr> | ||
355 | 257 | <tr><td>Target </td><td>The milestone the bug task is targeted to be fixed. </td></tr> | ||
356 | 258 | <tr><td>Duplicates</td><td>Quantity of duplicate bug reports. </td></tr> | ||
357 | 259 | </tbody> | ||
358 | 260 | </table> | ||
359 | 261 | <br /> | ||
360 | 262 | </div> | ||
361 | 263 | <div> | ||
362 | 264 | <br /> | ||
363 | 265 | <hr /> | ||
364 | 266 | <table width="100%%" cellspacing="0" cellpadding="0"> | ||
365 | 267 | <tr> | ||
366 | 268 | <td> | ||
367 | 269 | ${timestamp} | ||
368 | 270 | </td> | ||
369 | 271 | <td align="right"> | ||
370 | 272 | | ||
371 | 273 | Themes: | ||
372 | 274 | <a href='#' onclick="setActiveStyleSheet('dark'); return false;">DARK</a> | ||
373 | 275 | | ||
374 | 276 | <a href='#' onclick="setActiveStyleSheet('light'); return false;">LIGHT</a> | ||
375 | 277 | </td> | ||
376 | 278 | </tr> | ||
377 | 279 | </table> | ||
378 | 280 | <br /> | ||
379 | 281 | </div> | ||
380 | 282 | |||
381 | 283 | |||
382 | 284 | </div> <!-- Outermost --> | ||
383 | 285 | </body> | ||
384 | 286 | |||
385 | 287 | <script type="text/javascript"> | ||
386 | 288 | // add parser through the tablesorter addParser method | ||
387 | 289 | $.tablesorter.addParser({ | ||
388 | 290 | // set a unique id | ||
389 | 291 | id: 'age', | ||
390 | 292 | is: function(s) { return false; }, | ||
391 | 293 | format: function(s) { | ||
392 | 294 | // format your data for normalization | ||
393 | 295 | fields = s.split('.') | ||
394 | 296 | days = parseInt(fields[0], 10) * (60 * 24); | ||
395 | 297 | hours = parseInt(fields[1], 10) * 60; | ||
396 | 298 | minutes = parseInt(fields[2]); | ||
397 | 299 | total = minutes + hours + days | ||
398 | 300 | return total; | ||
399 | 301 | }, | ||
400 | 302 | // set type, either numeric or text | ||
401 | 303 | type: 'numeric' | ||
402 | 304 | }); | ||
403 | 305 | |||
404 | 306 | // add parser through the tablesorter addParser method | ||
405 | 307 | $.tablesorter.addParser({ | ||
406 | 308 | // set a unique id | ||
407 | 309 | id: 'importance', | ||
408 | 310 | is: function(s) { return false; }, | ||
409 | 311 | format: function(s) { | ||
410 | 312 | // format your data for normalization | ||
411 | 313 | return s.toLowerCase().replace(/critical/,6).replace(/high/,5).replace(/medium/,4).replace(/low/,3).replace(/wishlist/,2).replace(/undecided/,1).replace(/unknown/,0); | ||
412 | 314 | }, | ||
413 | 315 | // set type, either numeric or text | ||
414 | 316 | type: 'numeric' | ||
415 | 317 | }); | ||
416 | 318 | |||
417 | 319 | // add parser through the tablesorter addParser method | ||
418 | 320 | $.tablesorter.addParser({ | ||
419 | 321 | // set a unique id | ||
420 | 322 | id: 'status', | ||
421 | 323 | is: function(s) { return false; | ||
422 | 324 | }, | ||
423 | 325 | format: function(s) { | ||
424 | 326 | // format your data for normalization | ||
425 | 327 | return s.toLowerCase().replace(/new/,12).replace(/incomplete/,11).replace(/confirmed/,10).replace(/triaged/,9).replace(/in progress/,8).replace(/fix committed/,7).replace(/fix released/,6).replace(/invalid/,5).replace(/won't fix/,4).replace(/confirmed/,3).replace(/opinion/,2).replace(/expired/,1).replace(/unknown/,0); | ||
426 | 328 | }, | ||
427 | 329 | // set type, either numeric or text | ||
428 | 330 | type: 'numeric' | ||
429 | 331 | }); | ||
430 | 332 | $(function() { | ||
431 | 333 | % for team in team_report_order: | ||
432 | 334 | <% id = team.replace(' ', '_') %> | ||
433 | 335 | $("#${id}").tablesorter({ | ||
434 | 336 | headers: { | ||
435 | 337 | 3: { | ||
436 | 338 | sorter:'importance' | ||
437 | 339 | }, | ||
438 | 340 | 4: { | ||
439 | 341 | sorter:'status' | ||
440 | 342 | } | ||
441 | 343 | }, | ||
442 | 344 | widgets: ['zebra'] | ||
443 | 345 | }); | ||
444 | 346 | % endfor | ||
445 | 347 | }); | ||
446 | 348 | </script> | ||
447 | 349 | |||
448 | 350 | <script type="text/javascript"> | ||
449 | 351 | var series = ["precise", "jaunty", "oneiric", "karmic", "natty", "hardy", "maverick", "lucid", ""]; | ||
450 | 352 | var importance = ["Critical", "Low", "High", "Wishlist", "Medium", "Undecided"]; | ||
451 | 353 | var task_status = ["New", "Incomplete", "Confirmed", "Fix Released", "Triaged", "Won't Fix", "In Progress", "Opinion", "Fix Committed", "Invalid"]; | ||
452 | 354 | var assignees = []; | ||
453 | 355 | var date_filter = -1; | ||
454 | 356 | var jd = ${json_data_string}; | ||
455 | 357 | var first_time = true; | ||
456 | 358 | |||
457 | 359 | var importance_color = { | ||
458 | 360 | "Unknown" : "importance-unknown", | ||
459 | 361 | "Critical" : "importance-critical", | ||
460 | 362 | "High" : "importance-high", | ||
461 | 363 | "Medium" : "importance-medium", | ||
462 | 364 | "Low" : "importance-low", | ||
463 | 365 | "Wishlist" : "importance-wishlist", | ||
464 | 366 | "Undecided" : "importance-undecided" | ||
465 | 367 | }; | ||
466 | 368 | |||
467 | 369 | var status_color = { | ||
468 | 370 | "New" : "status-new", | ||
469 | 371 | "Incomplete" : "status-incomplete", | ||
470 | 372 | "Confirmed" : "status-confirmed", | ||
471 | 373 | "Triaged" : "status-triaged", | ||
472 | 374 | "In Progress" : "status-in_progress", | ||
473 | 375 | "Fix Committed" : "status-fix_committed", | ||
474 | 376 | "Fix Released" : "status-fix_released", | ||
475 | 377 | "Invalid" : "status-invalid", | ||
476 | 378 | "Won't Fix" : "status-wont_fix", | ||
477 | 379 | "Opinion" : "status-opinion", | ||
478 | 380 | "Expired" : "status-expired", | ||
479 | 381 | "Unknown" : "status-unknown" | ||
480 | 382 | }; | ||
481 | 383 | |||
482 | 384 | var teams_id_list = []; | ||
483 | 385 | var teams_name_list = []; | ||
484 | 386 | % for team in team_report_order: | ||
485 | 387 | <% id = team.replace(' ', '_') %> | ||
486 | 388 | teams_id_list.push("${id}"); | ||
487 | 389 | teams_name_list.push("${team}"); | ||
488 | 390 | % endfor | ||
489 | 391 | |||
490 | 392 | function series_handler(chkbx, grp, update_table) { | ||
491 | 393 | series = []; | ||
492 | 394 | for (i = 0; i < document.filter.length; i++) { | ||
493 | 395 | if (document.filter[i].name == "series") { | ||
494 | 396 | if (document.filter[i].checked) { | ||
495 | 397 | series.push(document.filter[i].value); | ||
496 | 398 | } | ||
497 | 399 | } | ||
498 | 400 | } | ||
499 | 401 | |||
500 | 402 | if (update_table) { | ||
501 | 403 | update_tables(); | ||
502 | 404 | } | ||
503 | 405 | } | ||
504 | 406 | |||
505 | 407 | function importance_handler(chkbx, grp, update_table) { | ||
506 | 408 | importance = []; | ||
507 | 409 | for (i = 0; i < document.filter.length; i++) { | ||
508 | 410 | if (document.filter[i].name == "importance") { | ||
509 | 411 | if (document.filter[i].checked) { | ||
510 | 412 | importance.push(document.filter[i].value); | ||
511 | 413 | } | ||
512 | 414 | } | ||
513 | 415 | } | ||
514 | 416 | |||
515 | 417 | if (update_table) { | ||
516 | 418 | update_tables(); | ||
517 | 419 | } | ||
518 | 420 | } | ||
519 | 421 | |||
520 | 422 | function assignee_handler(chkbx, grp, update_table) { | ||
521 | 423 | assignees = []; | ||
522 | 424 | for (i = 0; i < document.filter.length; i++) { | ||
523 | 425 | if (document.filter[i].name == "assignees") { | ||
524 | 426 | if (document.filter[i].checked) { | ||
525 | 427 | assignees.push(document.filter[i].value); | ||
526 | 428 | } | ||
527 | 429 | } | ||
528 | 430 | } | ||
529 | 431 | |||
530 | 432 | if (update_table) { | ||
531 | 433 | update_tables(); | ||
532 | 434 | } | ||
533 | 435 | } | ||
534 | 436 | |||
535 | 437 | function status_handler(chkbx, grp, update_table) { | ||
536 | 438 | task_status = []; | ||
537 | 439 | for (i = 0; i < document.filter.length; i++) { | ||
538 | 440 | if (document.filter[i].name == "status") { | ||
539 | 441 | if (document.filter[i].checked) { | ||
540 | 442 | task_status.push(document.filter[i].value); | ||
541 | 443 | } | ||
542 | 444 | } | ||
543 | 445 | } | ||
544 | 446 | |||
545 | 447 | if (update_table) { | ||
546 | 448 | update_tables(); | ||
547 | 449 | } | ||
548 | 450 | } | ||
549 | 451 | |||
550 | 452 | function date_handler(chkbx, grp, update_table) { | ||
551 | 453 | date_filter = -1; | ||
552 | 454 | for (i = 0; i < document.filter.length; i++) { | ||
553 | 455 | if (document.filter[i].name == "date") { | ||
554 | 456 | if (document.filter[i].checked) { | ||
555 | 457 | date_filter = parseInt(document.filter[i].value); | ||
556 | 458 | } | ||
557 | 459 | } | ||
558 | 460 | } | ||
559 | 461 | |||
560 | 462 | if (update_table) { | ||
561 | 463 | update_tables(); | ||
562 | 464 | } | ||
563 | 465 | } | ||
564 | 466 | |||
565 | 467 | function update_tables() { | ||
566 | 468 | var bug_total = 0; | ||
567 | 469 | var tables = { | ||
568 | 470 | % for team in team_report_order: | ||
569 | 471 | "${team}" : "", | ||
570 | 472 | % endfor | ||
571 | 473 | }; | ||
572 | 474 | var totals = { | ||
573 | 475 | % for team in team_report_order: | ||
574 | 476 | "${team}" : 0, | ||
575 | 477 | % endfor | ||
576 | 478 | }; | ||
577 | 479 | |||
578 | 480 | var oddness = { | ||
579 | 481 | % for team in team_report_order: | ||
580 | 482 | "${team}" : true, | ||
581 | 483 | % endfor | ||
582 | 484 | }; | ||
583 | 485 | |||
584 | 486 | $.each(jd, function(bid, tasks) { | ||
585 | 487 | $.each(tasks, function(index, task) { | ||
586 | 488 | var fail = false; | ||
587 | 489 | |||
588 | 490 | if (series.indexOf(task.bug.series_name) == -1) { | ||
589 | 491 | fail = true; | ||
590 | 492 | } | ||
591 | 493 | |||
592 | 494 | if (!fail && importance.indexOf(task.importance) == -1) { | ||
593 | 495 | fail = true; | ||
594 | 496 | } | ||
595 | 497 | |||
596 | 498 | if (!fail && task_status.indexOf(task.status) == -1) { | ||
597 | 499 | fail = true; | ||
598 | 500 | } | ||
599 | 501 | |||
600 | 502 | /* | ||
601 | 503 | if (!fail && assignees.indexOf(task.assignee) == -1) { | ||
602 | 504 | fail = true; | ||
603 | 505 | } | ||
604 | 506 | |||
605 | 507 | if (!fail && date_filter != -1) { | ||
606 | 508 | if (task.bug.age > date_filter) { | ||
607 | 509 | fail = true; | ||
608 | 510 | } | ||
609 | 511 | } | ||
610 | 512 | */ | ||
611 | 513 | |||
612 | 514 | s = ""; | ||
613 | 515 | if (!fail) { | ||
614 | 516 | bug_total++; | ||
615 | 517 | if (oddness[task.team]) { | ||
616 | 518 | s += "<tr class=\"odd\">"; | ||
617 | 519 | oddness[task.team] = false; | ||
618 | 520 | } else { | ||
619 | 521 | s += "<tr class=\"even\">"; | ||
620 | 522 | oddness[task.team] = true; | ||
621 | 523 | } | ||
622 | 524 | s += "<td><a href=\"http://launchpad.net/bugs/" + bid + "\">" + bid + "</a></td>"; | ||
623 | 525 | s += "<td>" + task.bug.title + "</td>"; | ||
624 | 526 | s += "<td>" + task.task_name + "</td>"; | ||
625 | 527 | s += "<td class=\"" + importance_color[task.importance] + "\">" + task.importance + "</td>"; | ||
626 | 528 | s += "<td class=\"" + status_color[task.status] + "\">" + task.status + "</td>"; | ||
627 | 529 | s += "<td>" + task.assignee + "</td>"; | ||
628 | 530 | s += "<td>" + task.milestone_found + "</td>"; | ||
629 | 531 | s += "<td>" + task.milestone_target + "</td>"; | ||
630 | 532 | s += "<td>" + task.bug.number_of_duplicates + "</td>"; | ||
631 | 533 | s += "</tr>"; | ||
632 | 534 | tables[task.team] += s; | ||
633 | 535 | totals[task.team]++; | ||
634 | 536 | } | ||
635 | 537 | }); | ||
636 | 538 | }); | ||
637 | 539 | |||
638 | 540 | $.each(tables, function(team, val) { | ||
639 | 541 | id = team.replace(/ /g, '_'); | ||
640 | 542 | $("#" + id + " tbody").html(tables[team]); | ||
641 | 543 | $("#" + id).trigger("update"); | ||
642 | 544 | % if 'show_total_bugs_per_team' in report_options and report_options['show_total_bugs_per_team']: | ||
643 | 545 | document.getElementById(team + "-total").innerHTML = totals[team]; | ||
644 | 546 | % endif | ||
645 | 547 | }); | ||
646 | 548 | if (first_time) { | ||
647 | 549 | first_time = false; | ||
648 | 550 | sortList = [[3,1], [4,1]]; | ||
649 | 551 | $.each(tables, function(team, val) { | ||
650 | 552 | id = team.replace(/ /g, '_'); | ||
651 | 553 | $("#" + id).trigger("sorton", [sortList]); | ||
652 | 554 | }); | ||
653 | 555 | } | ||
654 | 556 | % if 'show_total_bugs' in report_options and report_options['show_total_bugs']: | ||
655 | 557 | document.getElementById("bug-total").innerHTML = "Total: " + bug_total; | ||
656 | 558 | % endif | ||
657 | 559 | } | ||
658 | 560 | |||
659 | 561 | $(document).ready(function(){ | ||
660 | 562 | // Expand Panel | ||
661 | 563 | $("#open").click(function(){ $("div#panel").slideDown("slow"); }); | ||
662 | 564 | |||
663 | 565 | // Collapse Panel | ||
664 | 566 | $("#close").click(function(){ $("div#panel").slideUp("slow"); }); | ||
665 | 567 | |||
666 | 568 | // Switch buttons on the tab from "Options" to "Close" | ||
667 | 569 | $("#toggle a").click(function () { $("#toggle a").toggle(); }); | ||
668 | 570 | |||
669 | 571 | series_handler(null, null, false); | ||
670 | 572 | importance_handler(null, null, false); | ||
671 | 573 | status_handler(null, null, false); | ||
672 | 574 | /* | ||
673 | 575 | assignee_handler(null, null, false); | ||
674 | 576 | date_handler(null, null, false); | ||
675 | 577 | */ | ||
676 | 578 | update_tables(); | ||
677 | 579 | }); | ||
678 | 580 | </script> | ||
679 | 581 | |||
680 | 582 | </html> | ||
681 | 583 | <!-- vi:set ts=4 sw=4 expandtab syntax=mako: --> |