summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/dependency-tree.html.tmpl
blob: c31323846545fe28c8e38a2d12c65fb4d4e2f378 (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
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
[%# 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): Tobias Burnus <burnus@net-b.de>
  #                 Ville Skyttä <ville.skytta@iki.fi>
  #                 Myk Melez <myk@mozilla.org>
  #%]

[% PROCESS global/variables.none.tmpl %]

[% filtered_desc = blocked_tree.$bugid.summary FILTER html %]
[% PROCESS global/header.html.tmpl
   title = "Dependency tree for $terms.Bug $bugid"
   h1    = "Dependency tree for <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>"
   h2    = filtered_desc
%]

[% PROCESS depthControlToolbar %]

[%# Display the tree of bugs that this bug depends on. %]
<h3>
  [% IF hide_resolved %]
    Open [% terms.bugs %]
  [% ELSE %]
    [% terms.Bugs %]
  [% END %] 
  that <a href="show_bug.cgi?id=[% bugid %]">[% terms.bug %] [%+ bugid %]</a> 
  depends on</h3>
[% IF dependson_ids.size > 0 %]
  (
  [% IF maxdepth -%]Up to [% maxdepth %] level[% "s" IF maxdepth > 1 %] deep | [% END %]
  <a href="buglist.cgi?bug_id=[% dependson_ids.join(",") %]">view as [% terms.bug %] list</a>
  [% IF canedit && dependson_ids.size > 1 %]
    | <a href="buglist.cgi?bug_id=[% dependson_ids.join(",") %]&amp;tweak=1">change several</a>
  [% END %])
  [% INCLUDE display_tree tree=dependson_tree bug_id=bugid %]
[% ELSE %]
  </h3>
  <p>None</p>
[% END %]

[%# Display the tree of bugs that this bug blocks. %]
<h3>
  [% IF hide_resolved %]
    Open [% terms.bugs %]
  [% ELSE %]
    [% terms.Bugs %]
  [% END %] 
  that <a href="show_bug.cgi?id=[% bugid %]">[% terms.bug %] [%+ bugid %]</a> 
  blocks</h3>
[% IF blocked_ids.size > 0 %]
  (
  [% IF maxdepth -%]Up to [% maxdepth %] level[% "s" IF maxdepth > 1 %] deep | [% END %]
  <a href="buglist.cgi?bug_id=[% blocked_ids.join(",") %]">view as [% terms.bug %] list</a>
  [% IF canedit && blocked_ids.size > 1 %]
    | <a href="buglist.cgi?bug_id=[% blocked_ids.join(",") %]&amp;tweak=1">change several</a>
  [% END %])
  [% INCLUDE display_tree tree=blocked_tree bug_id=bugid %]
[% ELSE %]
  </h3>
  <p>None</p>
[% END %]

[% PROCESS depthControlToolbar %]

[% PROCESS global/footer.html.tmpl %]


[%###########################################################################%]
[%# Block to display a tree                                                 #%]
[%###########################################################################%]

[% BLOCK display_tree %]
[% tree.$bug_id.seen = 1 %]
<ul>
  [% FOREACH dep_id = tree.$bug_id.dependencies %]
    [% dep = tree.$dep_id %]
    <li>
      [% "<script>document.write('<a href=\"#\" class=\"toggle\" onclick=\"listToggle(event); return false\">[-]</a>')</script>"
         IF dep.dependencies.size > 0 && !dep.seen %]
      [% isclosed = !dep.open %]
      [% FILTER closed(isclosed) %]
      <a href="show_bug.cgi?id=[% dep_id %]">[% dep_id %]
        [[% IF dep.milestone %][% dep.milestone FILTER html %], [% END %]
        [% dep.assignee_email FILTER html %]] -
        [% IF dep.seen %]
          <i>This [% terms.bug %] appears elsewhere in this tree.</i></a>
        [% ELSE %]
          [%+ dep.summary FILTER html %].</a>
        [% END %]
      [% END %]
      [% INCLUDE display_tree bug_id=dep_id
           IF dep.dependencies.size > 0 && !dep.seen %]
    </li>
  [% END %]
</ul>
[% END %]

[%###########################################################################%]
[%# Block for depth control toolbar                                         #%]
[%###########################################################################%]

 <script type="text/javascript">
if (!Node) {
    /* MSIE doesn't define Node, so provide a compatibility array */
    var Node = { TEXT_NODE: 3, };
}

function toggleDisplay(node)
{
    var display = node.style.display;
    if (display == "none") {
        node.style.display =
           ("oldDisplay" in node) ? node.oldDisplay : "block";
        return true;
    }

    node.oldDisplay = display;
    node.style.display = "none";
    return false;
}

function listToggle(event)
{
    var node = event.target;
    if (node.nodeType == Node.TEXT_NODE)
        node = node.parentNode;
    var toggle = node.nextSibling;
    while (toggle && toggle.tagName != "UL")
      toggle = toggle.nextSibling;
    if (toggle) {
      node.firstChild.data = toggleDisplay(toggle) ? "[-]" : "[+]";
    }
}

 </script>
[% BLOCK depthControlToolbar %]
 <table cellpadding="3" border="0" cellspacing="0" bgcolor="#d0d0d0">
 <tr>
   [%# Hide/show resolved button
       Swaps text depending on the state of hide_resolved %]
   <td align="center">
   <form method="get" action="showdependencytree.cgi"
           style="display: inline; margin: 0px;">
     <input name="id" type="hidden" value="[% bugid %]">
     [% IF maxdepth %]
       <input name="maxdepth" type="hidden" value="[% maxdepth %]">
     [% END %]
     <input type="hidden" name="hide_resolved" value="[% hide_resolved ? 0 : 1 %]">
     <input type="submit" 
            value="[% IF hide_resolved %]Show[% ELSE %]Hide[% END %] Resolved">
   </form>
   </td>

   <td>
     Max Depth:
   </td>

   <td>
     &nbsp;
   </td>

   <td>
   <form method="get" action="showdependencytree.cgi"
         style="display: inline; margin: 0px;">
     [%# set to one form %]
     <input type="submit" value="&nbsp;1&nbsp;" 
       [% "disabled" IF realdepth < 2 || maxdepth == 1 %]>
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="maxdepth" type="hidden" value="1">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
   </form>
   </td>

   <td>
   <form method="get" action="showdependencytree.cgi"
         style="display: inline; margin: 0px;">
     [%# Minus one form
         Allow subtracting only when realdepth and maxdepth > 1 %]
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="maxdepth" type="hidden" value="[%
         maxdepth == 1 ? 1
                       : ( maxdepth ? maxdepth - 1 : realdepth - 1 )
     %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
     <input type="submit" value="&nbsp;&lt;&nbsp;" 
       [% "disabled" IF realdepth < 2 || ( maxdepth && maxdepth < 2 ) %]>
   </form>
   </td>

   <td>
   <form method="get" action="showdependencytree.cgi"
         style="display: inline; margin: 0px;">
     [%# Limit entry form: the button can not do anything when total depth
         is less than two, so disable it %]
     <input name="maxdepth" size="4" maxlength="4" value="[%
         maxdepth > 0 && maxdepth <= realdepth ? maxdepth : ""
     %]">
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
     <noscript>
       <input type="submit" value="Change" [% "disabled" IF realdepth < 2 %]>
     </noscript>
   </form>
   </td>

   <td>
   <form method="get" action="showdependencytree.cgi"
         style="display: inline; margin: 0px;">
     [%# plus one form
         Disable button if total depth < 2, or if depth set to unlimited %]
     <input name="id" type="hidden" value="[% bugid %]">
     [% IF maxdepth %]
       <input name="maxdepth" type="hidden" value="[% maxdepth + 1 %]">
     [% END %]
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
     <input type="submit" value="&nbsp;&gt;&nbsp;" 
        [% "disabled" IF realdepth < 2 || !maxdepth || maxdepth >= realdepth %]
    %]>
   </form>
   </td>

   <td>
   <form method="get" action="showdependencytree.cgi"
         style="display: inline; margin: 0px;">
     [%# Unlimited button %]
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
     <input type="submit" value="&nbsp;Unlimited&nbsp;"
       [% "disabled" IF maxdepth == 0 || maxdepth == realdepth %]>
   </form>
   </td>
 </tr>
</table>

[% END %]