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[% filtered_desc = blocked_tree.$bugid.short_desc FILTER html %] 10[% PROCESS global/header.html.tmpl 11 title = "Dependency tree for $terms.Bug $bugid" 12 header = "Dependency tree for 13 <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>" 14 javascript_urls = ["js/expanding-tree.js"] 15 style_urls = ["skins/standard/dependency-tree.css"] 16 subheader = filtered_desc 17 doc_section = "hintsandtips.html#dependencytree" 18%] 19 20[% PROCESS depthControlToolbar %] 21 22[% INCLUDE tree_section ids=dependson_ids type=1 %] 23 24[% INCLUDE tree_section ids=blocked_ids type=2 %] 25 26[% PROCESS depthControlToolbar %] 27 28[% PROCESS global/footer.html.tmpl %] 29 30[%###########################################################################%] 31[%# Tree-drawing blocks #%] 32[%###########################################################################%] 33 34[% BLOCK tree_section %] 35 [%# INTERFACE 36 # - ids: a list of bug IDs to be displayed as children 37 # - type: the type of tree. 1 = depends on, 2 = blockeds 38 # GLOBALS 39 # - seen: Maintains a global hash of bugs that have been displayed 40 #%] 41 [% global.seen = {} %] 42 [%# Display the tree of bugs that this bug depends on. %] 43 <h3> 44 <a href="show_bug.cgi?id=[% bugid %]">[% terms.Bug %] [%+ bugid %]</a> 45 [% IF type == 1 %] 46 [% tree_name = "dependson_tree" %] 47 [% IF ids.size %] 48 depends on 49 [% ELSE %] 50 does not depend on any [% 'open ' IF hide_resolved %][% terms.bugs %]. 51 [% END %] 52 [% ELSIF type == 2 %] 53 [% tree_name = "blocked_tree" %] 54 [% IF ids.size %] 55 blocks 56 [% ELSE %] 57 does not block any [% 'open ' IF hide_resolved %][% terms.bugs %]. 58 [% END %] 59 [% END %] 60 [% IF ids.size %] 61 [%+ (ids.size == 1) ? "one" : ids.size %] 62 [%+ IF hide_resolved %]open[% END %] 63 [%+ (ids.size == 1) ? terms.bug : terms.bugs %]: 64 [% END %] 65 </h3> 66 [% IF ids.size %] 67 [%# 27 chars is the length of buglist.cgi?tweak=&bug_id=" %] 68 [% use_post = (ids.join(",").length > constants.CGI_URI_LIMIT - 27 ) ? 1 : 0 %] 69 [% IF use_post %] 70 <form action="buglist.cgi" method="post"> 71 <input type="hidden" name="bug_id" value="[% ids.join(",") %]"> 72 [% END %] 73 74 [% IF maxdepth -%]Up to [% maxdepth %] level[% "s" IF maxdepth > 1 %] deep | [% END -%] 75 [% IF use_post %] 76 <button>view as [% terms.bug %] list</button> 77 [% IF user.in_group('editbugs') && ids.size > 1 %] 78 | <button type="submit" name="tweak" value="1">change several</button> 79 [% END %] 80 </form> 81 [% ELSE %] 82 <a href="buglist.cgi?bug_id=[% ids.join(",") %]">view as [% terms.bug %] list</a> 83 [% IF user.in_group('editbugs') && ids.size > 1 %] 84 | <a href="buglist.cgi?bug_id=[% ids.join(",") %]&tweak=1">change several</a> 85 [% END %] 86 [% END %] 87 88 <ul class="tree"> 89 [% INCLUDE display_tree tree=$tree_name %] 90 </ul> 91 [% END %] 92[% END %] 93 94 95[% BLOCK display_tree %] 96 [%# INTERFACE 97 # - bugid: the ID of the bug being displayed 98 # - tree: a hash of bug objects and of bug dependencies 99 #%] 100 [% bug = tree.$bugid %] 101 <li> 102 [%- INCLUDE bullet bugid=bugid tree=tree -%] 103 <span class="summ[% "_deep" IF tree.dependencies.$bugid.size %]" 104 id="[% bugid FILTER html %]" 105 [% IF global.seen.$bugid %] 106 onMouseover="duplicatedover('[% bugid FILTER html %]')" 107 onMouseout="duplicatedout('[% bugid FILTER html %]')" 108 [% END %]> 109 [%- INCLUDE buglink bug=bug bugid=bugid %] 110 </span> 111 [% IF global.seen.$bugid %] 112 <b><a title="Already displayed above; click to locate" 113 onclick="duplicated('[% bugid FILTER html %]')" 114 href="#b[% bugid %]">(*)</a></b> 115 [% ELSIF tree.dependencies.$bugid.size %] 116 <ul> 117 [% FOREACH depid = tree.dependencies.$bugid %] 118 [% INCLUDE display_tree bugid=depid %] 119 [% END %] 120 </ul> 121 [% END %] 122 </li> 123 [% global.seen.$bugid = 1 %] 124[% END %] 125 126[% BLOCK bullet %] 127 [% IF tree.dependencies.$bugid.size && ! global.seen.$bugid %] 128 [% extra_class = " b_open" %] 129 [% extra_args = 'onclick="return doToggle(this, event)"' %] 130 [% END %] 131 <a id="b[% bugid %]" 132 class="b [%+ extra_class FILTER none %]" 133 title="Click to expand or contract this portion of the tree. Hold down the Ctrl key while clicking to expand or contract all subtrees." 134 [% extra_args FILTER none %]> </a> 135[% END %] 136 137[% BLOCK buglink %] 138 [% isclosed = !bug.isopened %] 139 [% FILTER closed(isclosed) -%] 140 <a title="[% INCLUDE buginfo bug=bug %]" 141 href="show_bug.cgi?id=[% bugid %]"> 142 <b>[%- bugid %]:</b> 143 <span class="summ_text">[%+ bug.short_desc FILTER html %]</span> 144 <span class="summ_info">[[% INCLUDE buginfo %]]</span> 145 </a> 146 <a href="showdependencytree.cgi?id=[% bugid FILTER uri %]" 147 class="tree_link"> 148 <img src="skins/standard/dependency-tree/tree.png" 149 title="See dependency tree for [% terms.bug %] [%+ bugid FILTER html %]"> 150 </a> 151 [% END %] 152[% END %] 153 154[% BLOCK buginfo %] 155 [% display_value("bug_status", bug.bug_status) FILTER html -%] 156 [%- IF bug.resolution %] [%+ display_value("resolution", bug.resolution) FILTER html %][% END %]; 157 [%-%] assigned to [% bug.assigned_to.login FILTER email FILTER html %] 158 [% IF Param("usetargetmilestone") AND bug.target_milestone %] 159 [%-%]; target: [% bug.target_milestone FILTER html %] 160 [% END %] 161[% END %] 162 163[%###########################################################################%] 164[%# Block for depth control toolbar #%] 165[%###########################################################################%] 166 167[% BLOCK depthControlToolbar %] 168 <table cellpadding="3" border="0" cellspacing="0" bgcolor="#e0e0e0"> 169 <tr> 170 [%# Hide/show resolved button 171 Swaps text depending on the state of hide_resolved %] 172 <td align="center"> 173 <form method="get" action="showdependencytree.cgi" 174 style="display: inline; margin: 0px;"> 175 <input name="id" type="hidden" value="[% bugid %]"> 176 [% IF maxdepth %] 177 <input name="maxdepth" type="hidden" value="[% maxdepth %]"> 178 [% END %] 179 <input type="hidden" name="hide_resolved" value="[% hide_resolved ? 0 : 1 %]"> 180 <input type="submit" id="toggle_visibility" 181 value="[% IF hide_resolved %]Show[% ELSE %]Hide[% END %] Resolved"> 182 </form> 183 </td> 184 185 <td> 186 Max Depth: 187 </td> 188 189 <td> 190 191 </td> 192 193 <td> 194 <form method="get" action="showdependencytree.cgi" 195 style="display: inline; margin: 0px;"> 196 [%# set to one form %] 197 <input type="submit" id="change_maxdepth" 198 value=" 1 " 199 [% "disabled" IF realdepth < 2 || maxdepth == 1 %]> 200 <input name="id" type="hidden" value="[% bugid %]"> 201 <input name="maxdepth" type="hidden" value="1"> 202 <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> 203 </form> 204 </td> 205 206 <td> 207 <form method="get" action="showdependencytree.cgi" 208 style="display: inline; margin: 0px;"> 209 [%# Minus one form 210 Allow subtracting only when realdepth and maxdepth > 1 %] 211 <input name="id" type="hidden" value="[% bugid %]"> 212 <input name="maxdepth" type="hidden" value="[% 213 maxdepth == 1 ? 1 214 : ( maxdepth ? maxdepth - 1 : realdepth - 1 ) 215 %]"> 216 <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> 217 <input type="submit" id="decrease_depth" value=" < " 218 [% "disabled" IF realdepth < 2 || ( maxdepth && maxdepth < 2 ) %]> 219 </form> 220 </td> 221 222 <td> 223 <form method="get" action="showdependencytree.cgi" 224 style="display: inline; margin: 0px;"> 225 [%# Limit entry form: the button cannot do anything when total depth 226 is less than two, so disable it %] 227 <input name="maxdepth" size="4" maxlength="4" value="[% 228 maxdepth > 0 && maxdepth <= realdepth ? maxdepth : "" 229 %]"> 230 <input name="id" type="hidden" value="[% bugid %]"> 231 <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> 232 <noscript> 233 <input type="submit" id="change_depth" value="Change" 234 [% "disabled" IF realdepth < 2 %]> 235 </noscript> 236 </form> 237 </td> 238 239 <td> 240 <form method="get" action="showdependencytree.cgi" 241 style="display: inline; margin: 0px;"> 242 [%# plus one form 243 Disable button if total depth < 2, or if depth set to unlimited %] 244 <input name="id" type="hidden" value="[% bugid %]"> 245 [% IF maxdepth %] 246 <input name="maxdepth" type="hidden" value="[% maxdepth + 1 %]"> 247 [% END %] 248 <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> 249 <input type="submit" id="increase_depth" value=" > " 250 [% "disabled" IF realdepth < 2 || !maxdepth || maxdepth >= realdepth %]> 251 </form> 252 </td> 253 254 <td> 255 <form method="get" action="showdependencytree.cgi" 256 style="display: inline; margin: 0px;"> 257 [%# Unlimited button %] 258 <input name="id" type="hidden" value="[% bugid %]"> 259 <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> 260 <input type="submit" id="remove_limit" 261 value=" Unlimited " 262 [% "disabled" IF maxdepth == 0 || maxdepth == realdepth %]> 263 </form> 264 </td> 265 </tr> 266</table> 267 268[% END %] 269