1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
|
<tal:root
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
omit-tag="">
<metal:header define-macro="batched-table">
<tal:comment replace="nothing">
This macro expects the following variables defined:
:task_batch_navigator: an IBatchNavigator
Optional:
:listing_columns: a list of strings specifying columns to display
</tal:comment>
<table class="listing" width="67%"
tal:define="tasks task_batch_navigator/batch;
default_columns python:['id', 'title', 'status',
'importance'];
listing_columns listing_columns|default_columns">
<thead tal:define="listing_columns listing_columns|default_columns">
<tr metal:use-macro="context/@@+bugtask-macros-tableview/batching-header"
/>
<tr metal:use-macro="context/@@+bugtask-macros-tableview/sortable-header"
/>
</thead>
<tbody>
<tr tal:repeat="task tasks">
<metal:item use-macro="context/@@+bugtask-macros-tableview/item" />
</tr>
</tbody>
</table>
</metal:header>
<metal:header define-macro="table">
<tal:comment replace="nothing">
This macro expects the following variables defined:
:tasks: a list of task instances
Optional:
:listing_columns: a list of strings specifying columns to display
</tal:comment>
<table class="sortable listing" id="bugtask-table" width="67%"
tal:define="default_columns python:['id', 'product-or-package',
'title', 'status', 'importance'];
listing_columns listing_columns|default_columns">
<thead>
<tr metal:use-macro="context/@@+bugtask-macros-tableview/header" />
</thead>
<tbody>
<tr tal:repeat="task tasks">
<metal:item use-macro="context/@@+bugtask-macros-tableview/item" />
</tr>
</tbody>
</table>
</metal:header>
<metal:header define-macro="batching-header">
<tr class="results">
<td
tal:attributes="colspan listing_columns/count:len"
tal:content="structure task_batch_navigator/@@+navigation-links-upper" />
</tr>
</metal:header>
<metal:header define-macro="sortable-header">
<tr>
<th tal:condition="python:'select' in listing_columns">
Select
</th>
<th tal:condition="python:'id' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('id')">
<a tal:attributes="href python:view.getSortLink('id')">ID</a>
</th>
<th tal:condition="python:'title' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('title')">
<a tal:attributes="href python:view.getSortLink('title')">Title</a>
</th>
<th tal:condition="python:'package' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('sourcepackagename')">
<a tal:attributes="href python:view.getSortLink('sourcepackagename')">
Package
</a>
</th>
<th tal:condition="python:'product' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('product')">
<a tal:attributes="href python:view.getSortLink('product')">Project</a>
</th>
<th tal:condition="python:'importance' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('importance')"
>
<a tal:attributes="href python:view.getSortLink('importance')"
>Importance</a>
</th>
<th tal:condition="python:'assignedto' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('assignee')">
<a tal:attributes="href python:view.getSortLink('assignee')">Assignee</a>
</th>
<th tal:condition="python:'status' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('status')">
<a tal:attributes="href python:view.getSortLink('status')">Status</a>
</th>
<th tal:condition="python:'milestone' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('milestone')">
<a tal:attributes="href python:view.getSortLink('milestone')">Target</a>
</th>
<th tal:condition="python:'submittedon' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('datecreated')"
>
<a tal:attributes="href python:view.getSortLink('datecreated')"
>Reported</a>
</th>
<th tal:condition="python:'submittedby' in listing_columns"
tal:attributes="class python:view.getSortedColumnCSSClass('owner')">
<a tal:attributes="href python:view.getSortLink('owner')">Reporter</a>
</th>
</tr>
</metal:header>
<metal:header define-macro="header">
<tr>
<th tal:condition="python:'select' in listing_columns">
Select
</th>
<th tal:condition="python:'id' in listing_columns">
ID
</th>
<th tal:condition="python:'title' in listing_columns">
Title
</th>
<th tal:condition="python:'package' in listing_columns">
Package
</th>
<th tal:condition="python:'product' in listing_columns">
Project
</th>
<th tal:condition="python:'product-or-package' in listing_columns">
Target
</th>
<th tal:condition="python:'importance' in listing_columns">
Importance
</th>
<th tal:condition="python:'assignedto' in listing_columns">
Assignee
</th>
<th tal:condition="python:'status' in listing_columns">
Status
</th>
<th tal:condition="python:'milestone' in listing_columns">
Target
</th>
<th tal:condition="python:'submittedon' in listing_columns">
Reported
</th>
<th tal:condition="python:'submittedby' in listing_columns">
Reporter
</th>
</tr>
</metal:header>
<metal:header define-macro="item"
tal:define="package_name string:${task/distribution/name|string:}
${task/distroseries/name|string:}
${task/sourcepackagename/name|string:}">
<td tal:condition="python:'select' in listing_columns">
<input type="checkbox" name="task" value=""
tal:attributes="value task/id" />
</td>
<td tal:condition="python:'id' in listing_columns">
<a tal:attributes="href task/fmt:url"
tal:content="string:#${task/bug/id}"
style="text-decoration: underline">42</a>
</td>
<td tal:condition="python:'title' in listing_columns"
tal:content="task/bug/title">
title
</td>
<td tal:condition="python:'package' in listing_columns"
tal:content="python:package_name and package_name or '(none)'">
(none)
</td>
<td tal:condition="python:('product' in listing_columns) and task.product"
tal:content="task/product/name_with_project"
style="white-space: nowrap" >
[project group] project
</td>
<td tal:condition="python:'product-or-package' in listing_columns">
<span tal:condition="package_name"
tal:content="python:package_name and package_name or '(none)'">
(none)
</span>
<span tal:condition="task/product"
tal:content="task/product/name_with_project"
style="white-space: nowrap" >
[project group] project
</span>
</td>
<td tal:condition="python:'importance' in listing_columns"
tal:content="task/importance/title"
tal:attributes="class string:importance${task/importance/title}">
Medium
</td>
<td tal:condition="python:'assignedto' in listing_columns">
<a tal:condition="task/assignee"
tal:attributes="href task/assignee/fmt:url"
tal:content="task/assignee/displayname">
somebody
</a>
<span tal:condition="not: task/assignee">
-
</span>
</td>
<td tal:condition="python:'status' in listing_columns"
tal:content="task/status/title"
tal:attributes="class string:status${task/status/name}">
New
</td>
<td tal:condition="python:'milestone' in listing_columns"
tal:content="task/milestone/name|string:-">
milestone
</td>
<td tal:condition="python:'submittedon' in listing_columns">
<span
tal:attributes="title task/datecreated/fmt:datetime"
tal:content="task/datecreated/fmt:displaydate">
date
</span>
</td>
<td tal:condition="python:'submittedby' in listing_columns"
tal:content="task/owner/displayname|string:-">
name
</td>
</metal:header>
<metal:advanced_search_form define-macro="advanced_search_form">
<form class="long" name="search" method="get" action="">
<span tal:condition="view/current_package|nothing">
<input type="hidden" name="field.distribution"
tal:attributes="value view/current_package/distribution/name" />
<input type="hidden" name="field.sourcepackagename"
tal:attributes="value view/current_package/sourcepackagename/name"
/>
</span>
<tal:searchbox replace="structure view/widgets/searchtext" />
<metal:widget use-macro="context/@@+bugtarget-macros-search/sortwidget" />
<input type="submit" name="search" value="Search" />
<a tal:attributes="href view/getSimpleSearchURL">Simple search</a>
<fieldset>
<legend>Status and importance</legend>
<table>
<tr>
<td width="40%">
<div><label>Status:</label></div>
<div tal:repeat="widget_value view/getStatusWidgetValues">
<tal:checkbox
define="widget_id string:status.${widget_value/title}">
<input name="field.status:list"
type="checkbox"
tal:attributes="value widget_value/value;
checked widget_value/checked;
id widget_id"/>
<label style="font-weight: normal"
tal:content="widget_value/title"
tal:attributes="for widget_id">
Unconfirmed
</label>
</tal:checkbox>
</div>
</td>
<td width="30%">
<div><label>Importance:</label></div>
<div tal:repeat="widget_value view/getImportanceWidgetValues">
<tal:checkbox
define="widget_id string:importance.${widget_value/title}">
<input name="field.importance:list"
type="checkbox"
tal:attributes="value widget_value/value;
checked widget_value/checked;
id widget_id"/>
<label style="font-weight: normal"
tal:content="widget_value/title"
tal:attributes="for widget_id">Critical</label>
</tal:checkbox>
</div>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>People</legend>
<table>
<tr>
<td width="40%" tal:condition="view/shouldShowAssigneeWidget">
<table>
<tr>
<td><label>Assignee:</label></td>
</tr>
<tr>
<td>
<input
type="radio"
name="assignee_option"
value="any"
id="any"
checked="checked" />
<label style="font-weight: normal"
for="any">Doesn’t matter</label><br />
<input
type="radio"
name="assignee_option"
value="none"
id="none" />
<label style="font-weight: normal"
for="none"> Nobody</label><br />
<div class="field"
tal:define="error
python:view.getFieldError('assignee')">
<div tal:attributes="class python:error and 'error' or None">
<span style="white-space: nowrap">
<input
type="radio"
name="assignee_option"
id="assignee_option"
value="choose" />
<span
tal:content="structure view/widgets/assignee"/>
</span>
<div tal:condition="error"
class="message"
tal:content="error">An error on
owner widget
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
<td width="40%">
<table>
<tal:render-if condition="view/shouldShowReporterWidget">
<tr>
<td>
<label for="field.bug_reporter">Reporter:</label>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<div class="field"
tal:define="error
python:view.getFieldError('bug_reporter')">
<div tal:attributes="class python:error and 'error' or None">
<span tal:content="structure
view/widgets/bug_reporter"/>
<div class="message"
tal:condition="error"
tal:content="error">An error on owner widget
</div>
</div>
</div>
</td>
</tr>
</tal:render-if>
<tal:render-if condition="view/shouldShowCommenterWidget">
<tr>
<td>
<label for="field.bug_commenter">
Commenter:
</label>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<div class="field"
tal:define="error
python:view.getFieldError('bug_commenter')">
<div tal:attributes=
"class python:error and 'error' or None">
<span tal:content="structure
view/widgets/bug_commenter"/>
<div tal:condition="error"
class="message"
tal:content="error">An error on owner widget
</div>
</div>
</div>
</td>
</tr>
</tal:render-if>
<tal:render-if condition="view/shouldShowSubscriberWidget">
<tr>
<td>
<label for="field.subscriber">
Subscriber:
</label>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<div class="field"
tal:define="error
python:view.getFieldError('subscriber')">
<div tal:attributes=
"class python:error and 'error' or None">
<span tal:content="structure
view/widgets/subscriber"/>
<div tal:condition="error"
class="message"
tal:content="error">An error on owner widget
</div>
</div>
</div>
</td>
</tr>
</tal:render-if>
<tal:render-if condition="view/shouldShowStructuralSubscriberWidget">
<tr>
<td>
<label for="field.structural_subscriber"
tal:content="view/structural_subscriber_label" />
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<div class="field"
tal:define="error
python:view.getFieldError('structural_subscriber')">
<div tal:attributes=
"class python:error and 'error' or None">
<span tal:content="structure
view/widgets/structural_subscriber"/>
<div tal:condition="error"
class="message"
tal:content="error">An error on owner widget
</div>
</div>
</div>
</td>
</tr>
</tal:render-if>
</table>
</td>
<td> </td>
</tr>
</table>
</fieldset>
<fieldset tal:define="show_component_widget view/shouldShowComponentWidget">
<legend>Milestones, components, and tags</legend>
<table>
<tr>
<td>
<table tal:define="widget_values view/getMilestoneWidgetValues">
<tr>
<td><label for="field.milestone">Target milestone:</label></td>
</tr>
<tr>
<td tal:condition="widget_values">
<tal:block tal:repeat="widget_value widget_values">
<span
tal:define="widget_id string:milestone.${widget_value/title}">
<input name="field.milestone:list"
type="checkbox"
tal:attributes="value widget_value/value;
checked widget_value/checked;
id widget_id" />
<label style="font-weight: normal"
tal:content="widget_value/title"
tal:attributes="for widget_id">
dapper
</label>
</span>
<br />
</tal:block>
</td>
<td tal:condition="not:widget_values">(none)</td>
</tr>
</table>
</td>
<td tal:condition="show_component_widget">
<table>
<tr>
<td><label for="field.component">Component:</label></td>
</tr>
<tr>
<td tal:content="structure view/widgets/component"
tal:condition="show_component_widget">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<tal:XXX condition="nothing">
# XXX: Bjorn Tillenius 2006-10-02:
# The rendering of the widget is pretty much copied from
# the widget macro; the difference is that we want to
# render the widget in a table, and the label should
# be rendered on the same line as the widget. When
# FormLayout lands we should be able to use the
# standard macro instead.
</tal:XXX>
<td span="2"
tal:define="error view/widgets/tag/error">
<div tal:attributes="class python:error and 'error' or ''">
<label tal:attributes="for view/widgets/tag/name"
tal:content="structure view/widgets/tag/label">
Tag
</label>: <input tal:replace="structure view/widgets/tag" />
<a href="/+help-bugs/tag-search.html"
target="help">Tag search help</a>
<div
tal:condition="error"
class="message"
tal:content="structure error"
>An error message.</div>
</div>
<div condition="view/shouldShowTagsCombinatorWidget"
class="value">
<label style="font-weight: normal">
<input id="field.tags_combinator.0"
name="field.tags_combinator"
value="ANY" checked="checked"
class="radioType" type="radio" /> Any
</label>
<br />
<label style="font-weight: normal">
<input id="field.tags_combinator.1"
name="field.tags_combinator"
value="ALL"
class="radioType" type="radio" /> All
</label>
</div>
</td>
</tr>
</table>
</fieldset>
<fieldset tal:condition="view/shouldShowUpstreamStatusBox">
<legend>Upstream status</legend>
<table>
<tr>
<td style="white-space: nowrap"
tal:content="structure view/widgets/status_upstream" />
</tr>
</table>
</fieldset>
<fieldset>
<legend>Bug relationships</legend>
<table>
<tr>
<td style="white-space: nowrap">
<input tal:replace="structure view/widgets/has_cve" />
<label style="font-weight: normal"
tal:attributes="for view/widgets/has_cve/name">
Show only bugs associated with a CVE
</label>
</td>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/omit_dupes" />
<label style="font-weight: normal"
for="field.omit_dupes">Hide duplicate bugs</label>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<input tal:replace="structure view/widgets/affects_me" />
<label style="font-weight: normal"
tal:attributes="for view/widgets/affects_me/name">
Show only bugs affecting me
</label>
</td>
<td style="white-space: nowrap"
tal:condition="view/shouldShowNoPackageWidget">
<span tal:content="structure view/widgets/has_no_package" />
<label style="font-weight: normal" for="field.has_no_package">
Hide bugs with packages specified
</label>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/has_patch" />
<label style="font-weight: normal" for="field.has_patch">
Show only bugs with patches available
</label>
</td>
<td>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/has_branches" />
<label style="font-weight: normal" for="field.has_branches">
Show bugs with linked branches
</label>
</td>
<td>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/has_no_branches" />
<label style="font-weight: normal" for="field.has_no_branches">
Show bugs without linked branches
</label>
</td>
<td>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/has_blueprints" />
<label style="font-weight: normal" for="field.has_blueprints">
Show bugs with linked blueprints
</label>
</td>
<td>
</td>
</tr>
<tr>
<td style="white-space: nowrap">
<span tal:content="structure view/widgets/has_no_blueprints" />
<label style="font-weight: normal" for="field.has_no_blueprints">
Show bugs without linked blueprints
</label>
</td>
<td>
</td>
</tr>
</table>
</fieldset>
<div style="margin-top: 1em;"><input type="submit" name="search" value="Search" /></div>
</form>
</metal:advanced_search_form>
<metal:listing_navigator define-macro="activate_listing_js">
<script type="text/javascript"
tal:define="
show_new_listings request/features/bugs.dynamic_bug_listings.enabled;
advanced_search view/shouldShowAdvancedForm"
tal:condition="python: show_new_listings and not advanced_search">
LPS.use('lp.bugs.buglisting', 'lp.ordering', 'lp.buglisting_utils',
function(Y) {
Y.on('domready', function() {
var navigator = Y.lp.bugs.buglisting.ListingNavigator.from_page();
if (Y.Lang.isNull(navigator)){
return;
}
var orderby = new Y.lp.ordering.OrderByBar({
srcNode: Y.one('#bugs-orderby'),
sort_keys: [
['id', 'Bug number'],
['title', 'Bug title'],
['importance', 'Importance'],
['status', 'Status'],
['heat', 'Bug heat']
],
active: 'importance',
sort_order: 'desc',
config_slot: true
});
orderby.render();
Y.on('orderbybar:sort', function(e) {
navigator.first_batch(e);
});
var config_node = orderby.get('config_node');
var list_util = new Y.lp.buglisting_utils.BugListingConfigUtil({
srcNode: config_node,
model: navigator.get('model')
});
list_util.render();
Y.on('buglisting-config-util:fields-changed', function(e) {
navigator.change_fields(list_util.get('field_visibility'));
});
});
});
</script>
</metal:listing_navigator>
</tal:root>
|