1[%# This Source Code Form is subject to the terms of the Mozilla Public
2  # License, v. 2.0. If a copy of the MPL was not distributed with this
3  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # defined by the Mozilla Public License, v. 2.0.
7  #%]
8
9[%# INTERFACE:
10  # bugs: list of hashes. May be empty. Each hash has three members:
11  #   bug: A Bugzilla::Bug object
12  #   count: integer. The number of dupes
13  #   delta: integer. The change in count in the last $changedsince days
14  #
15  # bug_ids: list of integers. May be empty. The IDs of the bugs in $bugs.
16  #
17  # sortby: string. the column on which we are sorting the buglist.
18  # reverse: boolean. True if we are reversing the current sort.
19  # maxrows: integer. Max number of rows to display.
20  # changedsince: integer. The number of days ago for the changedsince column.
21  # openonly: boolean. True if we are only showing open bugs.
22  # product: array of strings. Restrict to these products only.
23  #%]
24
25[%# *** Column Headers *** %]
26
27[% SET columns = [
28    { name => "id", description => "$terms.Bug #" },
29    { name => "count", description => "重複<br>数" },
30    { name => "delta",
31      description => "$changedsince 日以内<br>に更新" },
32    { name => "component", description => field_descs.component },
33    { name => "bug_severity", description => field_descs.bug_severity },
34    { name => "op_sys", description => field_descs.op_sys },
35    { name => "target_milestone", description => field_descs.target_milestone },
36    { name => "short_desc", description => field_descs.short_desc },
37] %]
38
39          <th>
40[% SET base_args = [] %]
41[% FOREACH param = ['maxrows', 'openonly', 'format', 'sortvisible',
42                    'changedsince', 'product']
43%]
44  [% NEXT IF NOT ${param}.defined %]
45  [% FOREACH value = ${param} %]
46    [% filtered_value = value FILTER uri %]
47    [% base_args.push("$param=$filtered_value") %]
48  [% END %]
49[% END %]
50[% IF sortvisible %]
51  [% bug_ids_string = bug_ids.nsort.join(',') FILTER uri %]
52  [% base_args.push("bug_id=$bug_ids_string") %]
53[% END %]
54[% base_args_string = base_args.join('&amp;') %]
55
56[% IF bugs.size %]
57  <table id="duplicates_table" cellpadding="0" cellspacing="0">
58    <thead>
59      <tr>
60        [% FOREACH column = columns %]
61          [% IF column.name == sortby %]
62            [%# We add this to the column object so it doesn't affect future
63              # iterations of the loop.
64              #%]
65            [% column.reverse_sort = reverse ? 0 : 1 %]
66          [% END %]
67          <th class="[% column.name FILTER html %]">
68            <a href="duplicates.cgi?sortby=[% column.name FILTER uri %]
69                     [% IF column.reverse_sort.defined %]
70                      [%- %]&amp;reverse=[% column.reverse_sort FILTER uri %]
71                     [% END %]
72                     [% IF base_args_string %]
73                       [% "&amp;$base_args_string" FILTER none %]
74                     [% END %]"
75            >[% column.description FILTER none %]</a>
76          </th>
77        [% END %]
78      </tr>
79    </thead>
80
81    [%# *** Buglist *** %]
82
83    <tbody>
84      [% FOREACH item = bugs %]
85        [% SET bug = item.bug %]
86        <tr [% " class='resolved'" IF NOT bug.isopened %]>
87          <td class="id">
88            [% bug.id FILTER bug_link(bug) FILTER none %]
89          </td>
90          <td class="count">[% item.count FILTER html %]</td>
91          <td class="delta">[% item.delta FILTER html %]</td>
92          <td class="component">[% bug.component FILTER html %]</td>
93          <td class="bug_severity">
94            [%- display_value('bug_severity', bug.bug_severity) FILTER html %]
95          </td>
96          <td class="op_sys">
97            [%- display_value('op_sys', bug.op_sys) FILTER html %]
98          </td>
99          <td class="target_milestone">
100            [% display_value('target_milestone',
101                             bug.target_milestone) FILTER html %]
102          </td>
103          <td class="short_desc">[% bug.short_desc FILTER html %]</td>
104        </tr>
105      [% END %]
106    </tbody>
107  </table>
108[% ELSE %]
109  <h3>重複 [% terms.bugs %] は検出されませんでした。</h3>
110[% END %]
111