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