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