show-multiple.html.tmpl 12.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Terry Weissman <terry@mozilla.org>
  #                 Gervase Markham <gerv@gerv.net>
20 21
  #                 Toms Baugis <toms@myrealbox.com>
  #                 Olav Vitters <olav@bkor.dhs.org>
22
  #                 Max Kanat-Alexander <mkanat@bugzilla.org>
23
  #                 Elliotte Martin <emartin@everythingsolved.com>
24 25
  #%]

26
[% PROCESS "global/field-descs.none.tmpl" %]
27 28 29

[% PROCESS global/header.html.tmpl
  title = "Full Text $terms.Bug Listing"
30 31 32
  h1 = ""
  style_urls = ["skins/standard/show_multiple.css",
                "skins/standard/buglist.css"]
33
  doc_section = "bug_page.html"
34
%]
35
[% PROCESS bug/time.html.tmpl %]
36
[% IF bugs.first %]
37
  [% ids = [] %]
38 39
  [% FOREACH bug = bugs %]
    [% PROCESS bug_display %]
40
    [% ids.push(bug.bug_id) UNLESS bug.error %]
41 42 43 44
  [% END %]
  [% IF ids.size > 1 %]
    <div class="bz_query_buttons">
      <form method="post" action="buglist.cgi">
45
        <input type="hidden" name="bug_id" value="[% ids.join(",") FILTER html %]">
46 47 48
        <input type="submit" id="short_format" value="Short Format">
      </form>
    </div>
49 50 51
  [% END %]
[% ELSE %]
  <p>
52
    You'd have more luck if you gave me some [% terms.bug %] numbers.
53 54 55
  </p>
[% END %]

56

57
[% PROCESS global/footer.html.tmpl %]
58 59 60 61 62 63 64


[%###########################################################################%]
[%# Block for an individual bug                                             #%]
[%###########################################################################%]

[% BLOCK bug_display %]
65 66
  <h1>
    [% terms.Bug %] 
67
    <a href="show_bug.cgi?id=[% bug.bug_id FILTER html %]">[% bug.bug_id FILTER html %]</a>
68
    [% IF Param("usebugaliases") AND bug.alias AND NOT bug.error %]
69
      (<a href="show_bug.cgi?id=[% bug.alias FILTER uri %]">
70
        [% bug.alias FILTER html %]</a>)
71 72 73 74
    [% END %]
  </h1>

  <table class="bugfields">
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
  [% IF bug.error %]
    <tr>
      <td class="error">
        [% IF bug.error == "InvalidBugId" %]
          '[%+ bug.bug_id FILTER html %]' is not a valid [% terms.bug %] number
          [%- IF Param("usebugaliases") %] nor a known [% terms.bug %] alias[% END %].
        [% ELSIF bug.error == "NotPermitted" %]
          You are not allowed to view this [% terms.bug %].
        [% ELSIF bug.error == "NotFound" %]
          This [% terms.bug %] cannot be found.
        [% ELSE %]
          [%+ bug.error FILTER html %]
        [% END %]
      </td>
    </tr>
  [% ELSE %]
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    [%# The rightcell block (also called by the row block) automatically shows
      # the fields from rightcells %]
    [% rightcells = ['reporter', 'assigned_to'] %]
    [% IF Param('useqacontact') %]
      [% rightcells.push('qa_contact') %]
    [% END %]
    [% rightcells.push('') %]
    [% IF bug.cc %]
      [% rightcells.push('cc') %]
    [% END %]
    [% IF bug.keywords %]
      [% rightcells.push('keywords') %]
    [% END %]

    [%# Determine if the bug has a flag %]
    [% FOREACH type = bug.flag_types %]
      [% IF type.flags.size %]
        [% rightcells.push('flags') %]
        [% LAST %]
      [% END %]
    [% END %]

    [% PROCESS row cell = "short_desc" fullrow = 1 %]
114 115

    <tr>
116
      <th>[% field_descs.product FILTER html %]:</th>
117
      <td>
118
        [% IF Param("useclassification") && bug.classification_id != 1 %]
119 120 121 122 123
          [[% bug.classification FILTER html %]]&nbsp;
        [% END %]
        [% bug.product FILTER html %]
      </td>

124
      [% PROCESS rightcell %]
125
    </tr>
126

127 128
    [% PROCESS row cell = "component" %]

129
    <tr>
130
      <th>[% field_descs.bug_status  FILTER html %]:</th>
131
      <td>
132 133
        [% display_value("bug_status", bug.bug_status) FILTER html %]
        [%+ display_value("resolution", bug.resolution) FILTER html %]
134
      </td>
135

136
      [% PROCESS rightcell %]
137
    </tr>
138

139
    <tr>
140 141
      <th>[% field_descs.bug_severity FILTER html %]:</th>
      <td class="bz_[% bug.bug_severity FILTER css_class_quote -%]">
142
        [% display_value("bug_severity", bug.bug_severity) FILTER html %]
143
      </td>
144

145
      [% PROCESS rightcell %]
146
    </tr>
147

148
    <tr>
149 150 151
      <th>[% field_descs.priority FILTER html %]:</th>
      <td class="bz_[% bug.priority FILTER css_class_quote -%]">
        [% bug.priority FILTER html %]
152
      </td>
153 154

      [% PROCESS rightcell %]
155
    </tr>
156

157 158 159 160 161 162
    [% PROCESS row cell = "version" %]
    [% PROCESS row cell = "target_milestone"  IF Param('usetargetmilestone') %]
    [% PROCESS row cell = "rep_platform" %]
    [% PROCESS row cell = "op_sys"  %]

    [% IF bug.bug_file_loc %]
163
      <tr>
164 165 166 167 168 169 170 171
        <th>[% field_descs.bug_file_loc FILTER html %]:</th>
        <td colspan="3">
          [% IF bug.bug_file_loc.match("^(javascript|data)") %]
            [% bug.bug_file_loc FILTER html %]
          [% ELSE %]
            <a href="[% bug.bug_file_loc FILTER html %]">
                     [% bug.bug_file_loc FILTER html %]</a>
          [% END %]
172 173 174 175 176
        </td>
      </tr>
    [% END %]

    [% IF Param("usestatuswhiteboard") %]
177 178 179
      [% PROCESS row cell = "status_whiteboard" fullrow = 1 %]
    [% END %]

180 181
    [% USE Bugzilla %]
    [% field_counter = 0 %]
182
    [% FOREACH field = Bugzilla.active_custom_fields %]
183 184 185 186 187 188
        [% field_counter = field_counter + 1 %]
        [%# Odd-numbered fields get an opening <tr> %]
        [% '<tr>' IF field_counter % 2 %]
        [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=0 %]
        [%# Even-numbered fields get a closing <tr> %]
        [% '</tr>' IF !(field_counter % 2) %]
189 190 191 192 193 194 195
        [% IF extra_field_item %]
          [% field_counter = field_counter + 1 %]
          [% '<tr>' IF field_counter % 2 %]
          <th>[% extra_field_item.header FILTER none %]</th>
          <td>[% extra_field_item.data FILTER none %]</td>
          [% '</tr>' IF !(field_counter % 2) %]
        [% END %]
196 197 198 199
    [% END %]
    [%# And we have to finish the row if we ended on an odd number. %]
    [% '<th></th><td></td></tr>' IF field_counter % 2 %]

200 201 202 203 204
    [% IF (bug.dependson.size || bug.blocked.size) %]
      [% PROCESS dependencies name = "dependson" %]
      [% PROCESS dependencies name = "blocked"  %]
    [% END %]

205
    [% IF user.is_timetracker %]
206
      <tr>
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
        <th>Time tracking:</th>
        <td colspan="3">
          <table class="timetracking">
            <tr>
              <th>[% field_descs.estimated_time FILTER html %]</th>
              <th>[% field_descs.actual_time FILTER html %]</th>
              <th>[% field_descs.work_time FILTER html %]</th>
              <th>[% field_descs.remaining_time FILTER html %]</th>
              <th>[% field_descs.percentage_complete FILTER html %]</th>
              <th>Gain</th>
            </tr>
            <tr>
              <td>
                [% PROCESS formattimeunit time_unit = bug.estimated_time %]
              </td>
              <td>
                [% PROCESS formattimeunit
                           time_unit=(bug.remaining_time + bug.actual_time) %]
              </td>
              <td>[% PROCESS formattimeunit time_unit = bug.actual_time %]</td>
              <td>
                [% PROCESS formattimeunit time_unit = bug.remaining_time %]
              </td>
              <td>
                [% PROCESS calculatepercentage act = bug.actual_time
                                               rem = bug.remaining_time %]
              </td>
              <td>
                [% PROCESS formattimeunit
                     time_unit=bug.estimated_time - 
                               (bug.actual_time + bug.remaining_time) %]
              </td>
            </tr>
          </table>
241 242
        </td>
      </tr>
243
      [% PROCESS row cell="deadline" %]
244 245
    [% END %]

246
    [% IF bug.attachments.size %]
247
      <tr>
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
        <th>Attachments:</th>
        <td colspan="3">
          [% IF bug.show_attachment_flags %]
            <table>
              <tr>
                <th>Description</th>
                <th>Flags</th>
              </tr>
              [% FOREACH attachment = bug.attachments %]
                <tr>
                  <td>
                    <a href="attachment.cgi?id=[% attachment.id %]">
                      [% attachment.description FILTER html %]
                    </a>[% "<br>" IF not loop.last() %]
                  </td>
                  <td>
                    [% IF attachment.flags.size == 0 %]
                      <i>none</i>
                    [% ELSE %]
                      [% FOREACH flag = attachment.flags %]
                        [% flag.setter.nick FILTER html %]:
                        [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %]
                        [% IF flag.status == "?" && flag.requestee %]
                          ([% flag.requestee.nick FILTER html %])
                        [% END %][% ", " IF not loop.last() %]
                      [% END %]
                    [% END %]
                  </td>
                </tr>
              [% END %]
            </table>
          [% ELSE %]
            [% FOREACH attachment = bug.attachments %]
              <a href="attachment.cgi?id=[% attachment.id %]">
                [% attachment.description FILTER html %]
              </a>[% "<br>" IF not loop.last() %]
            [% END %]
          [% END %]
286 287 288
        </td>
      </tr>
    [% END %]
289
  [% END %]
290 291 292
  
  [% Hook.process("last_row", "bug/show-multiple.html.tmpl") %]
   
293 294
  </table>

295 296 297

  <br>

298
  [% PROCESS bug/comments.html.tmpl
299
     comments = bug.comments %]
300

301 302 303 304
[% END %]


[%###########################################################################%]
305
[%# Block for standard table rows                                           #%]
306 307
[%###########################################################################%]

308 309 310
[% BLOCK row %]
  <tr>
    <th>[% field_descs.${cell} FILTER html %]:</th>
311
    <td[% " colspan=3" IF fullrow %]>[% display_value(cell, bug.${cell}) FILTER html %]</td>
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
    [% PROCESS rightcell IF !fullrow %]
  </tr>
  [% fullrow = 0 %]
[% END %]


[%############################################################################%]
[%# Block for dependencies                                                   #%]
[%############################################################################%]

[% BLOCK dependencies %]
  <tr>
    <th>[% terms.Bug %] [%+ field_descs.${name} FILTER html %]:</th>
    <td>
      [% FOREACH depbug = bug.${name} %]
327
        [% depbug FILTER bug_link(depbug) FILTER none %][% ", " IF not loop.last() %]
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
      [% END %]
    </td>

    [% PROCESS rightcell %]
  </tr>
[% END %]

[%############################################################################%]
[%# Block for cells shown right of the table                                 #%]
[%############################################################################%]

[% BLOCK rightcell %]
  [% IF rightcells %]
    [% name = rightcells.shift %]
    [% IF name == "cc" %]
      <th class="rightcell">[% field_descs.cc FILTER html %]:</th>
      <td>
        [% FOREACH c = bug.cc %]
346
          [% c FILTER email FILTER html %][% ", " IF not loop.last() %]
347 348 349 350
        [% END %]
    [% ELSIF name == "reporter" || name == "assigned_to" 
             || name == "qa_contact" %]
      <th class="rightcell">[% field_descs.${name} FILTER html %]:</th>
351
      <td>[% bug.${name}.identity FILTER email FILTER html %]</td>
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
    [% ELSIF name == "flags" %]
        <th class="rightcell">Flags:</th>
        <td>
          [% FOREACH type = bug.flag_types %]
            [% FOREACH flag = type.flags %]
                [% flag.setter.nick FILTER html %]:
                [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %]
                [%+ IF flag.status == "?" && flag.requestee %]
                  ([% flag.requestee.nick FILTER html %])
                [% END %]<br>
            [% END %]
          [% END %]
        </td>
    [% ELSIF name != "" %]
      <th class="rightcell">[% field_descs.${name} FILTER html %]:</th>
367
      <td>[% display_value(name, bug.${name}) FILTER html %]</td>
368 369 370 371 372
    [% ELSE %]
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    [% END %]
  [% END %]
373
[% END %]