diff-file.html.tmpl 4.76 KB
Newer Older
1
[%# 1.0@bugzilla.org %]
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
[%# 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): John Keiser <jkeiser@netscape.com>
  #%]

[%# This line is really long for a reason: to get rid of any possible textnodes
  # between the elements.  This is necessary because DOM parent-child-sibling
  # relations can change and screw up the javascript for restoring, collapsing
  # and expanding.  Do not change without testing all three of those.
  #%]
27
<table class="file_table"><thead><tr><td class="file_head" colspan="2"><a href="#" onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] style="display: none"> 
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  [% IF lxr_prefix && !file.is_add %]
    <a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a>
  [% ELSE %]
    [% file.filename FILTER html %]
  [% END %]
  [% IF file.plus_lines %]
    [% IF file.minus_lines %]
      (-[% file.minus_lines %]&nbsp;/&nbsp;+[% file.plus_lines %]&nbsp;lines)
    [% ELSE %]
      (+[% file.plus_lines %]&nbsp;lines)
    [% END %]
  [% ELSE %]
    [% IF file.minus_lines %]
      (-[% file.minus_lines %]&nbsp;lines)
    [% END %]
  [% END %]
</td></tr></thead><tbody class="[% collapsed ? 'file_collapse' : 'file' %]">
45
<script type="text/javascript">
46 47 48 49 50 51
incremental_restore()
</script>

[% section_num = 0 %]
[% FOREACH section = sections %]
  [% section_num = section_num + 1 %]
52 53 54
  <tr><th colspan="2" class="section_head">
    <table cellpadding="0" cellspacing="0">
    <tr><th width="95%" align="left">
55 56 57 58 59 60 61 62 63 64 65 66 67
  [% IF file.is_add %]
    Added
  [% ELSIF file.is_remove %]
    [% IF bonsai_prefix %]
      <a href="[% bonsai_prefix %]">Removed</a>
    [% ELSE %]
      Removed
    [% END %]
  [% ELSE %]
    [% IF bonsai_prefix %]
      <a href="[% bonsai_prefix %]#[% section.old_start %]">
    [% END %]
    [% IF section.old_lines > 1 %]
68 69
      &nbsp;Lines&nbsp;[% section.old_start %]-[% section.old_start + 
                                             section.old_lines - 1 %]
70
    [% ELSE %]
71
      Line&nbsp;[% section.old_start %]
72 73 74 75
    [% END %]
    [% IF bonsai_prefix %]
      </a>
    [% END %]
76
    &nbsp;&nbsp;[% section.func_info FILTER html IF section.func_info %]
77
  [% END %] 
78
    </th><th>
79
  <a name="[% file.filename FILTER html %]_sec[% section_num %]" href="#[% file.filename FILTER html %]_sec[% section_num %]">Link&nbsp;Here</a>&nbsp;
80
    </th></tr></table>
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
  </th></tr>
  [% FOREACH group = section.groups %]
    [% IF group.context %]
      [% FOREACH line = group.context %]
        <tr><td><pre>[% line FILTER html %]</pre></td><td><pre>[% line FILTER html %]</pre></td></tr>
      [% END %]
    [% END %]
    [% IF group.plus.size %]
      [% IF group.minus.size %]
        [% i = 0 %]
        [% WHILE (i < group.plus.size || i < group.minus.size) %]
          [% currentloop = 0 %]
          [% WHILE currentloop < 500 && (i < group.plus.size || i < group.minus.size) %]
            <tr class="changed">
              <td><pre>[% group.minus.$i FILTER html %]</pre></td>
              <td><pre>[% group.plus.$i FILTER html %]</pre></td>
            </tr>
            [% currentloop = currentloop + 1 %]
            [% i = i + 1 %]
          [% END %]
        [% END %]
      [% ELSE %]
        [% FOREACH line = group.plus %]
          [% IF file.is_add %]
            <tr>
              <td class="added" colspan="2"><pre>[% line FILTER html %]</pre></td>
            </tr>
          [% ELSE %]
            <tr>
              <td></td>
              <td class="added"><pre>[% line FILTER html %]</pre></td>
            </tr>
          [% END %]
        [% END %]
      [% END %]
    [% ELSE %]
      [% IF group.minus.size %]
        [% FOREACH line = group.minus %]
          [% IF file.is_remove %]
            <tr>
              <td class="removed" colspan="2"><pre>[% line FILTER html %]</pre></td>
            </tr>
          [% ELSE %]
            <tr>
              <td class="removed"><pre>[% line FILTER html %]</pre></td>
              <td></td>
            </tr>
          [% END %]
        [% END %]
      [% END %]
    [% END %]
  [% END %]
[% END %]

</table>