summaryrefslogtreecommitdiffstats
path: root/template/en/default/list/table.html.tmpl
blob: 6d5ee0d6cc11397f13761b5cb86e53a3aa9ab521 (plain)
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
<!-- 1.0@bugzilla.org -->
[%# 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): Myk Melez <myk@mozilla.org>
  #%]

[%############################################################################%]
[%# Initialization                                                           #%]
[%############################################################################%]

[%# Columns whose titles or values should be abbreviated to make the list
  # more compact.  For columns whose titles should be abbreviated,
  # the shortened title is included.  For columns whose values should be
  # abbreviated, a maximum length is provided along with the ellipsis that
  # should be added to an abbreviated value, if any.
  # wrap is set if a column's contents should be allowed to be word-wrapped
  # by the browser.
  #%]
[% abbrev = 
  {
    "severity"          => { maxlength => 3 , title => "Sev" } , 
    "priority"          => { maxlength => 3 , title => "Pri" } , 
    "platform"          => { maxlength => 3 , title => "Plt" } , 
    "status"            => { maxlength => 4 } , 
    "reporter"          => { maxlength => 30 , ellipsis => "..." } , 
    "owner"             => { maxlength => 30 , ellipsis => "..." } , 
    "qa_contact"        => { maxlength => 30 , ellipsis => "..." , title => "QAContact" } , 
    "resolution"        => { maxlength => 4 } , 
    "summary"           => { maxlength => 60 , ellipsis => "..." , wrap => 1 } ,
    "summaryfull"       => { wrap => 1 } ,
    "status_whiteboard" => { title => "StatusSummary" , wrap => 1 } , 
    "component"         => { maxlength => 8 , title => "Comp" } , 
    "product"           => { maxlength => 8 } , 
    "version"           => { maxlength => 5 , title => "Vers" } , 
    "os"                => { maxlength => 4 } , 
    "target_milestone"  => { title => "TargetM" } , 
  }
%]

[% qorder = order FILTER url_quote IF order %]

[%############################################################################%]
[%# Table Header                                                             #%]
[%############################################################################%]

[% tableheader = BLOCK %]
  <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
    <colgroup>
      <col class="bz_id_column">
      [% FOREACH id = displaycolumns %]
      <col class="bz_[% id %]_column">
      [% END %]
    </colgroup>

    <tr align="left">
      <th colspan="[% splitheader ? 2 : 1 %]">
        <a href="buglist.cgi?[% urlquerypart %]&amp;order=bugs.bug_id">ID</a>
      </th>

      [% IF splitheader %]

        [% FOREACH id = displaycolumns %]
          [% NEXT UNLESS loop.count() % 2 == 0 %]
          [% column = columns.$id %]
          [% PROCESS columnheader %]
        [% END %]

        </tr><tr align="left"><th>&nbsp;</th>

        [% FOREACH id = displaycolumns %]
          [% NEXT IF loop.count() % 2 == 0 %]
          [% column = columns.$id %]
          [% PROCESS columnheader %]
        [% END %]

      [% ELSE %]

        [% FOREACH id = displaycolumns %]
          [% column = columns.$id %]
          [% PROCESS columnheader %]
        [% END %]

      [% END %]

    </tr>
[% END %]

[% BLOCK columnheader %]
  <th colspan="[% splitheader ? 2 : 1 %]">
    <a href="buglist.cgi?[% urlquerypart %]&amp;order=
      [% column.name FILTER url_quote FILTER html %]
      [% ",$qorder" FILTER html IF order %]">
        [%- abbrev.$id.title || column.title -%]</a>
  </th>
[% END %]


[%############################################################################%]
[%# Bug Table                                                                #%]
[%############################################################################%]

[% FOREACH bug = bugs %]
  [% FLUSH IF loop.count() % 10 == 1 %]

  [%# At the beginning of every hundred bugs in the list, start a new table. %]
  [% IF loop.count() % 100 == 1 %]
    [% tableheader %]
  [% END %]

  <tr class="bz_[% bug.severity %] bz_[% bug.priority %] [%+ "bz_secure" IF (bug.groupset && !usebuggroups) %]">

    <td>
      [% IF dotweak %]<input type="checkbox" name="id_[% bug.id %]">[% END %]
      <a href="show_bug.cgi?id=[% bug.id %]">[% bug.id %]</a>
    </td>

    [% FOREACH column = displaycolumns %]
    <td>
      [% '<nobr>' IF NOT abbrev.$column.wrap %]
      [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%]
      [%- '</nobr>' IF NOT abbrev.$column.wrap %]
    </td>
    [% END %]

  </tr>

  [%# At the end of every hundred bugs in the list, or at the end of the list,
    # end the current table. 
    #%]
  [% IF loop.last() || loop.count() % 100 == 0 %]
    </table>
  [% END %]

[% END %]