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