dependency-tree.html.tmpl 9.55 KB
Newer Older
1 2 3 4
[%# 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/
5
  #
6 7 8 9 10 11 12 13 14 15 16 17 18
  # 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>
19
  #                 Ville Skyttä <ville.skytta@iki.fi>
20
  #                 Myk Melez <myk@mozilla.org>
21
  #                 André Batosti <batosti@async.com.br>
22 23
  #%]

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

26
[% filtered_desc = blocked_tree.$bugid.short_desc FILTER html %]
27
[% PROCESS global/header.html.tmpl
28 29 30
   title           = "Dependency tree for $terms.Bug $bugid"
   header          = "Dependency tree for 
                      <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>"
31
   javascript_urls = ["js/expanding-tree.js"]
32 33
   style_urls      = ["skins/standard/dependency-tree.css"]
   subheader      = filtered_desc
34
   doc_section = "hintsandtips.html#dependencytree"
35 36 37
%]

[% PROCESS depthControlToolbar %]
38 39 40 41
  
[% INCLUDE tree_section ids=dependson_ids type=1 %]
 
[% INCLUDE tree_section ids=blocked_ids type=2 %] 
42 43 44

[% PROCESS depthControlToolbar %]

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

47
[%###########################################################################%]
48
[%# Tree-drawing blocks                                                     #%]
49 50
[%###########################################################################%]

51 52 53 54 55 56 57 58 59 60
[% BLOCK tree_section %]
  [%# INTERFACE
    #   - ids: a list of bug IDs to be displayed as children
    #   - type: the type of tree. 1 = depends on, 2 = blockeds
    # GLOBALS
    #   - seen: Maintains a global hash of bugs that have been displayed
    #%]
  [% global.seen = {} %]
  [%# Display the tree of bugs that this bug depends on. %]
  <h3>
61
    <a href="show_bug.cgi?id=[% bugid %]">[% terms.Bug %] [%+ bugid %]</a> 
62 63
    [% IF type == 1 %]
        [% tree_name = "dependson_tree" %]
64 65 66 67 68
        [% IF ids.size %]
            depends on 
        [% ELSE %]
            does not depend on any [% terms.bugs %].
        [% END %]
69 70
    [% ELSIF type == 2 %]
        [% tree_name = "blocked_tree" %]
71 72 73 74 75
        [% IF ids.size %] 
            blocks 
        [% ELSE %]
            does not block any [% terms.bugs %].
        [% END %]
76
    [% END %]
77 78 79 80 81
    [% IF ids.size %]
        [%+ (ids.size == 1) ? "one" : ids.size %]
        [%+ IF hide_resolved %]open[% END %]
        [%+ (ids.size == 1) ? terms.bug : terms.bugs %]:
    [% END %] 
82
  </h3>
83
  [% IF ids.size %]
84 85
    ([% IF maxdepth -%]Up to [% maxdepth %] level[% "s" IF maxdepth > 1 %] deep | [% END -%]
    <a href="buglist.cgi?bug_id=[% ids.join(",") %]">view as [% terms.bug %] list</a>
86
    [% IF user.groups.editbugs && ids.size > 1 %]
87 88 89 90 91
      | <a href="buglist.cgi?bug_id=[% ids.join(",") %]&amp;tweak=1">change several</a>
    [% END %])
    <ul class="tree">
      [% INCLUDE display_tree tree=$tree_name %]
    </ul>
92 93 94
  [% END %]
[% END %]

95

96 97 98
[% BLOCK display_tree %]
  [%# INTERFACE
    #   - bugid: the ID of the bug being displayed
99
    #   - tree: a hash of bug objects and of bug dependencies
100 101 102
    #%]
  [% bug = tree.$bugid %]
  <li>
103 104
    [%- INCLUDE bullet bugid=bugid tree=tree -%]
    <span class="summ[% "_deep" IF tree.dependencies.$bugid.size %]" 
105 106 107 108 109 110 111 112 113 114 115
          id="[% bugid FILTER html %]" 
          [% IF global.seen.$bugid %]
            onMouseover="duplicatedover('[% bugid FILTER html %]')"
            onMouseout="duplicatedout('[% bugid FILTER html %]')"
          [% END %]>
      [%- INCLUDE buglink bug=bug bugid=bugid %]
    </span>
    [% IF global.seen.$bugid %]
      <b><a title="Already displayed above; click to locate"
            onclick="duplicated('[% bugid FILTER html %]')"
            href="#b[% bugid %]">(*)</a></b>
116
    [% ELSIF tree.dependencies.$bugid.size %]
117
      <ul>
118
        [% FOREACH depid = tree.dependencies.$bugid %]
119 120 121 122 123 124 125
          [% INCLUDE display_tree bugid=depid %]
        [% END %]
      </ul>
    [% END %]
  </li>
  [% global.seen.$bugid = 1 %]
[% END %]
126

127
[% BLOCK bullet %]
128
  [% IF tree.dependencies.$bugid.size && ! global.seen.$bugid %]
129 130 131 132 133 134 135 136
    [% extra_class = " b_open" %]
    [% extra_args = 'onclick="return doToggle(this, event)"' %] 
  [% END %]
  <a name="b[% bugid %]" 
     class="b [%+ extra_class FILTER none %]"
     title="Click to expand or contract this portion of the tree. Hold down the Ctrl key while clicking to expand or contract all subtrees."
     [% extra_args FILTER none %]>&nbsp;&nbsp;</a>
[% END %]
137

138
[% BLOCK buglink %]
139
  [% isclosed = !bug.isopened %]
140 141 142 143
  [% FILTER closed(isclosed) -%]
    <a title="[% INCLUDE buginfo bug=bug %]"
       href="show_bug.cgi?id=[% bugid %]">
      <b>[%- bugid %]:</b>
144
      <span class="summ_text">[%+ bug.short_desc FILTER html %]</span>
145 146
      <span class="summ_info">[[% INCLUDE buginfo %]]</span>
    </a>
147
    <a href="showdependencytree.cgi?id=[% bugid FILTER url_quote %]"
148 149
       class="tree_link">
      <img src="skins/standard/dependency-tree/tree.png"
150
           title="See dependency tree for [% terms.bug %] [%+ bugid FILTER html %]">
151
    </a>
152 153
  [% END %]
[% END %]
154

155
[% BLOCK buginfo %]
156
  [% bug.bug_status FILTER html -%] [%+ bug.resolution FILTER html %];
157 158
  [%-%] assigned to [% bug.assigned_to.login FILTER html %]
  [%-%][% "; Target: " _ bug.target_milestone IF bug.target_milestone %]
159
[% END %]
160 161 162 163 164

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

165
[% BLOCK depthControlToolbar %]
166 167
 <table cellpadding="3" border="0" cellspacing="0" bgcolor="#e0e0e0">
   <tr>
168 169 170
   [%# Hide/show resolved button
       Swaps text depending on the state of hide_resolved %]
   <td align="center">
171
   <form method="get" action="showdependencytree.cgi"
172 173 174
           style="display: inline; margin: 0px;">
     <input name="id" type="hidden" value="[% bugid %]">
     [% IF maxdepth %]
175
       <input name="maxdepth" type="hidden" value="[% maxdepth %]">
176 177
     [% END %]
     <input type="hidden" name="hide_resolved" value="[% hide_resolved ? 0 : 1 %]">
178
     <input type="submit" id="toggle_visibility"
179
            value="[% IF hide_resolved %]Show[% ELSE %]Hide[% END %] Resolved">
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
   </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 %]
195 196
     <input type="submit" id="change_maxdepth"
       value="&nbsp;1&nbsp;" 
197
       [% "disabled" IF realdepth < 2 || maxdepth == 1 %]>
198 199 200 201 202 203 204
     <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>
205
   <form method="get" action="showdependencytree.cgi"
206
         style="display: inline; margin: 0px;">
207
     [%# Minus one form
208 209
         Allow subtracting only when realdepth and maxdepth > 1 %]
     <input name="id" type="hidden" value="[% bugid %]">
210 211
     <input name="maxdepth" type="hidden" value="[%
         maxdepth == 1 ? 1
212 213 214
                       : ( maxdepth ? maxdepth - 1 : realdepth - 1 )
     %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
215
     <input type="submit" id="decrease_depth" value="&nbsp;&lt;&nbsp;"
216
       [% "disabled" IF realdepth < 2 || ( maxdepth && maxdepth < 2 ) %]>
217 218 219 220
   </form>
   </td>

   <td>
221
   <form method="get" action="showdependencytree.cgi"
222 223 224
         style="display: inline; margin: 0px;">
     [%# Limit entry form: the button can not do anything when total depth
         is less than two, so disable it %]
225
     <input name="maxdepth" size="4" maxlength="4" value="[%
226
         maxdepth > 0 && maxdepth <= realdepth ? maxdepth : ""
227 228 229 230
     %]">
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
     <noscript>
231 232
       <input type="submit" id="change_depth" value="Change"
              [% "disabled" IF realdepth < 2 %]>
233 234 235 236 237
     </noscript>
   </form>
   </td>

   <td>
238
   <form method="get" action="showdependencytree.cgi"
239
         style="display: inline; margin: 0px;">
240
     [%# plus one form
241 242 243 244 245 246
         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 %]">
247
     <input type="submit" id="increase_depth" value="&nbsp;&gt;&nbsp;" 
248
        [% "disabled" IF realdepth < 2 || !maxdepth || maxdepth >= realdepth %]>
249 250 251 252
   </form>
   </td>

   <td>
253
   <form method="get" action="showdependencytree.cgi"
254 255 256 257
         style="display: inline; margin: 0px;">
     [%# Unlimited button %]
     <input name="id" type="hidden" value="[% bugid %]">
     <input name="hide_resolved" type="hidden" value="[% hide_resolved %]">
258 259
     <input type="submit" id="remove_limit"
       value="&nbsp;Unlimited&nbsp;"
260
       [% "disabled" IF maxdepth == 0 || maxdepth == realdepth %]>
261 262 263 264
   </form>
   </td>
 </tr>
</table>
265

266
[% END %]