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[%############################################################################%]
10[%# Initialization                                                           #%]
11[%############################################################################%]
12
13[%# Don't display the table or do any processing if there are no bugs
14  # to display %]
15[% RETURN IF !bugs.size %]
16
17[%# Columns whose titles or values should be abbreviated to make the list
18  # more compact.  For columns whose titles should be abbreviated,
19  # the shortened title is included.  For columns whose values should be
20  # abbreviated, a maximum length is provided along with the ellipsis that
21  # should be added to an abbreviated value, if any.
22  # wrap is set if a column's contents should be allowed to be word-wrapped
23  # by the browser.
24  #%]
25
26[% field_descs.short_short_desc     = field_descs.short_desc  %]
27[% field_descs.assigned_to_realname = field_descs.assigned_to %]
28[% field_descs.reporter_realname    = field_descs.reporter    %]
29[% field_descs.qa_contact_realname  = field_descs.qa_contact  %]
30
31[% abbrev =
32  {
33    "bug_severity"         => { maxlength => 3 , title => "Schw" } ,
34    "priority"             => { maxlength => 7 , title => "Pri" } ,
35    "rep_platform"         => { maxlength => 3 , title => "Hdw" } ,
36    "bug_status"           => { maxlength => 5 } ,
37    "assigned_to"          => { maxlength => 30 , ellipsis => "…" } ,
38    "assigned_to_realname" => { maxlength => 20 , ellipsis => "…" } ,
39    "reporter"             => { maxlength => 30 , ellipsis => "…" } ,
40    "reporter_realname"    => { maxlength => 20 , ellipsis => "…" } ,
41    "qa_contact"           => { maxlength => 30 , ellipsis => "…" , title => "QS-Kontakt" } ,
42    "qa_contact_realname"  => { maxlength => 20 , ellipsis => "…" , title => "QS-Kontakt" } ,
43    "resolution"        => { maxlength => 5 } ,
44    "short_desc"        => { wrap => 1 } ,
45    "short_short_desc"  => { maxlength => 60 , ellipsis => "…" , wrap => 1 } ,
46    "status_whiteboard" => { title => "Statusnotiz" , wrap => 1 } ,
47    "keywords"          => { wrap => 1 } ,
48    "flagtypes.name"    => { wrap => 1 } ,
49    "component"         => { maxlength => 8 , title => "$terms.Comp" } ,
50    "product"           => { maxlength => 8 , title => "$terms.Prod" } ,
51    "version"           => { maxlength => 5 , title => "Vers" } ,
52    "op_sys"            => { maxlength => 4 } ,
53    "bug_file_loc"      => { maxlength => 30 } ,
54    "target_milestone"  => { title => "Ziel-M." } ,
55    "longdescs.count"   => { title => "Anzahl Kommentare" },
56    "percentage_complete" => { format_value => "%d %%" } ,
57  }
58%]
59
60[% PROCESS bug/time.html.tmpl %]
61
62[% Hook.process("before_table") %]
63
64[%############################################################################%]
65[%# Table Header                                                             #%]
66[%############################################################################%]
67
68[% tableheader = BLOCK %]
69  <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
70    <tr class="bz_buglist_header bz_first_buglist_header">
71      [% IF dotweak %]
72      <th>&nbsp;</th>
73      [% END %]
74      <th colspan="[% splitheader ? 2 : 1 %]" class="first-child">
75        <a href="buglist.cgi?
76                  [% urlquerypart FILTER html %]&amp;order=
77                  [% PROCESS new_order id='bug_id' %]
78                  [%-#%]&amp;query_based_on=
79                  [% defaultsavename OR searchname FILTER uri %]">ID
80          [% PROCESS order_arrow id='bug_id' ~%]
81        </a>
82      </th>
83
84      [% IF splitheader %]
85
86        [% FOREACH id = displaycolumns %]
87          [% NEXT UNLESS loop.count() % 2 == 0 %]
88          [% column = columns.$id %]
89          [% PROCESS columnheader %]
90        [% END %]
91
92        </tr><tr class="bz_buglist_header">
93        [% IF dotweak %]
94          <th>&nbsp;</th>
95        [% END %]
96        <th>&nbsp;</th>
97
98        [% FOREACH id = displaycolumns %]
99          [% NEXT IF loop.count() % 2 == 0 %]
100          [% column = columns.$id %]
101          [% PROCESS columnheader %]
102        [% END %]
103
104      [% ELSE %]
105
106        [% FOREACH id = displaycolumns %]
107          [% column = columns.$id %]
108          [% PROCESS columnheader %]
109        [% END %]
110
111      [% END %]
112
113    </tr>
114[% END %]
115
116[% BLOCK columnheader %]
117  <th colspan="[% splitheader ? 2 : 1 %]">
118    <a href="buglist.cgi?[% urlquerypart FILTER html %]&amp;order=
119      [% PROCESS new_order %]
120      [%-#%]&amp;query_based_on=
121      [% defaultsavename OR searchname FILTER uri %]">
122        [%- abbrev.$id.title || field_descs.$id || column.title FILTER html -%]
123        [% PROCESS order_arrow ~%]
124    </a>
125  </th>
126[% END %]
127
128[% BLOCK new_order %]
129  [% desc = '' %]
130  [% IF (om = order.match("\\b$id( DESC)?")) %]
131    [% desc = ' DESC' IF NOT om.0 %]
132  [% END %]
133  [% id _ desc FILTER uri %]
134  [% IF id != 'bug_id' AND order %]
135    [% ',' _ order.remove("\\b$id( DESC)?(,\\s*|\$)") FILTER uri %]
136  [% END %]
137[% END %]
138
139[% BLOCK order_arrow %]
140  [% IF order.match("^$id DESC") %]
141    <span class="bz_sort_order_primary">&#x25BC;</span>
142  [% ELSIF order.match("^$id(,\\s*|\$)") %]
143    <span class="bz_sort_order_primary">&#x25B2;</span>
144  [% ELSIF order.match("\\b$id DESC") %]
145    <span class="bz_sort_order_secondary">&#x25BC;</span>
146  [% ELSIF order.match("\\b$id(,\\s*|\$)") %]
147    <span class="bz_sort_order_secondary">&#x25B2;</span>
148  [% END %]
149[% END %]
150
151[%############################################################################%]
152[%# Bug Table                                                                #%]
153[%############################################################################%]
154
155[% tableheader %]
156
157[% FOREACH bug = bugs %]
158  [% count = loop.count() %]
159
160  <tr id="b[% bug.bug_id %]" class="bz_bugitem
161             bz_[% bug.bug_severity FILTER css_class_quote -%]
162             bz_[% bug.priority FILTER css_class_quote -%]
163             bz_[% bug.bug_status FILTER css_class_quote -%]
164             [%+ "bz_$bug.resolution" FILTER css_class_quote IF bug.resolution -%]
165             [%+ "bz_secure" IF bug.secure_mode -%]
166             [%+ "bz_secure_mode_$bug.secure_mode" FILTER css_class_quote IF bug.secure_mode -%]
167             [%+ count % 2 == 1 ? "bz_row_odd" : "bz_row_even" -%]
168             ">
169
170
171    [% IF dotweak %]
172    <td class="bz_checkbox_column">
173      <input type="checkbox" name="id_[% bug.bug_id %]">
174    </td>
175    [% END %]
176    <td class="first-child bz_id_column">
177      <a href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>
178      <span style="display: none">[%+ '[SEC]' IF bug.secure_mode %]</span>
179    </td>
180
181    [% FOREACH column = displaycolumns %]
182    <td [% 'style="white-space: nowrap"' IF NOT abbrev.$column.wrap %]
183        class="bz_[% column FILTER css_class_quote %]_column">
184      [% IF abbrev.$column.maxlength %]
185        <span title="[%- display_value(column, bug.$column) FILTER html %]">
186      [% END %]
187      [% IF abbrev.$column.format_value %]
188        [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%]
189      [% ELSIF column == 'actual_time' ||
190               column == 'remaining_time' ||
191               column == 'estimated_time' %]
192        [% PROCESS formattimeunit time_unit=bug.$column %]
193      [% ELSIF column == 'deadline' %]
194        [% bug.$column.split('-').reverse.join('.') %]
195      [%# Display the login name of the user if their real name is empty. %]
196      [% ELSIF column.match('_realname$') && bug.$column == '' %]
197        [% SET login_column = column.remove('_realname$') %]
198        [% bug.${login_column}.truncate(abbrev.$column.maxlength,
199                                        abbrev.$column.ellipsis) FILTER html %]
200      [% ELSIF column == 'short_desc' || column == "short_short_desc" %]
201        <a href="show_bug.cgi?id=[% bug.bug_id FILTER html %]">
202          [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
203        </a>
204      [% ELSE %]
205        [%- display_value(column, bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
206      [% END %]
207      [% IF abbrev.$column.maxlength %]
208        </span>
209      [% END %]
210    </td>
211    [% END %]
212
213  </tr>
214
215  [% IF loop.last() && time_info.time_present == 1 %]
216    [% PROCESS time_summary_line %]
217  [% END %]
218
219[% END %]
220
221</table>
222
223[% BLOCK time_summary_line %]
224  <tr class="bz_time_summary_line">
225    [% columns_to_span = 1 %]  [%# bugID %]
226    [% IF dotweak %]
227      [% columns_to_span = columns_to_span + 1 %]
228    [% END %]
229    [% FOREACH column = displaycolumns %]
230      [% IF column == 'actual_time' ||
231            column == 'remaining_time' ||
232            column == 'estimated_time' ||
233            column == 'percentage_complete' %]
234        [% IF columns_to_span > 0 %]
235          <td class="bz_total bz_total_label" colspan="
236              [%- columns_to_span FILTER html %]"><b>Gesamt</b></td>
237          [% columns_to_span = 0 %]
238        [% END %]
239        [% IF column == 'percentage_complete' %]
240          <td class="bz_total">[% time_info.percentage_complete
241              FILTER format(abbrev.$column.format_value) FILTER html %]</td>
242        [% ELSE %]
243          <td class="bz_total">
244            [%- PROCESS formattimeunit time_unit=time_info.$column %]</td>
245        [% END %]
246      [% ELSIF columns_to_span == 0 %] [%# A column following the first total %]
247        <td class="bz_total">&nbsp;</td>
248      [% ELSE %] [%# We haven't gotten to a time column yet, keep computing span %]
249        [% columns_to_span = columns_to_span + 1 %]
250      [% END %]
251    [% END %]
252  </tr>
253[% END %]
254