aboutsummaryrefslogtreecommitdiffstats
path: root/template/en
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-07-09 15:46:53 +0000
committerlpsolit%gmail.com <>2009-07-09 15:46:53 +0000
commit677b3a96fb73d9558ddda0cc9a21d9b94421ab5d (patch)
treed115d847b8d3353b088a616f59a42ffa5c5a70a7 /template/en
parentac0544069d03896a414e42d1b31a1d7362bb9f39 (diff)
downloadbugs-677b3a96fb73d9558ddda0cc9a21d9b94421ab5d.tar
bugs-677b3a96fb73d9558ddda0cc9a21d9b94421ab5d.tar.gz
bugs-677b3a96fb73d9558ddda0cc9a21d9b94421ab5d.tar.bz2
bugs-677b3a96fb73d9558ddda0cc9a21d9b94421ab5d.tar.xz
bugs-677b3a96fb73d9558ddda0cc9a21d9b94421ab5d.zip
Bug 352615: Group empty cells together to reduce the size of the diff page - Patch by Frédéric Buclin <LpSolit@gmail.com> a=LpSolit (module owner)
Diffstat (limited to 'template/en')
-rw-r--r--template/en/default/attachment/diff-file.html.tmpl42
-rw-r--r--template/en/default/filterexceptions.pl2
2 files changed, 25 insertions, 19 deletions
diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl
index 85dd2208e..9392ca105 100644
--- a/template/en/default/attachment/diff-file.html.tmpl
+++ b/template/en/default/attachment/diff-file.html.tmpl
@@ -16,6 +16,7 @@
# Rights Reserved.
#
# Contributor(s): John Keiser <jkeiser@netscape.com>
+ # Frédéric Buclin <LpSolit@gmail.com>
#%]
[%# This line is really long for a reason: to get rid of any possible textnodes
@@ -99,30 +100,31 @@ incremental_restore()
[% IF group.plus.size %]
[% IF group.minus.size %]
[% i = 0 %]
- [%# We need to store them in external variables. %]
- [% curr_new = current_line_new %]
- [% curr_old = current_line_old %]
[% WHILE (i < group.plus.size || i < group.minus.size) %]
+ [%# WHILE cannot loop more than 1000 times by default, so we break it every 500 times. %]
[% currentloop = 0 %]
[% WHILE currentloop < 500 && (i < group.plus.size || i < group.minus.size) %]
<tr>
- <td class="num">[% curr_old %]</td>
+ [% IF i < group.minus.size %]
+ <td class="num">[% current_line_old + i %]</td>
<td class="changed"><pre>[% group.minus.$i FILTER html %]</pre></td>
- <td class="num">[% curr_new %]</td>
+ [% ELSIF i == group.minus.size %]
+ [% rowspan = group.plus.size - group.minus.size %]
+ <td class="num"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ <td class="changed"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ [% END %]
+
+ [% IF i < group.plus.size %]
+ <td class="num">[% current_line_new + i %]</td>
<td class="changed"><pre>[% group.plus.$i FILTER html %]</pre></td>
+ [% ELSIF i == group.plus.size %]
+ [% rowspan = group.minus.size - group.plus.size %]
+ <td class="num"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ <td class="changed"[% IF rowspan > 1 %] rowspan="[% rowspan FILTER none %]"[% END %]></td>
+ [% END %]
</tr>
[% currentloop = currentloop + 1 %]
[% i = i + 1 %]
- [% IF i < group.minus.size %]
- [% curr_old = curr_old + 1 %]
- [% ELSE %]
- [% curr_old = "" %]
- [% END %]
- [% IF i < group.plus.size %]
- [% curr_new = curr_new + 1 %]
- [% ELSE %]
- [% curr_new = "" %]
- [% END %]
[% END %]
[% END %]
[% current_line_old = current_line_old + group.minus.size %]
@@ -136,7 +138,10 @@ incremental_restore()
</tr>
[% ELSE %]
<tr>
- <td class="num"></td><td></td>
+ [% IF loop.first %]
+ <td class="num"[% IF group.plus.size > 1 %] rowspan="[% group.plus.size %]"[% END %]></td>
+ <td[% IF group.plus.size > 1 %] rowspan="[% group.plus.size %]"[% END %]></td>
+ [% END %]
<td class="num">[% current_line_new %]</td>
<td class="added"><pre>[% line FILTER html %]</pre></td>
</tr>
@@ -156,7 +161,10 @@ incremental_restore()
<tr>
<td class="num">[% current_line_old %]</td>
<td class="removed"><pre>[% line FILTER html %]</pre></td>
- <td class="num"></td><td></td>
+ [% IF loop.first %]
+ <td class="num"[% IF group.minus.size > 1 %] rowspan="[% group.minus.size %]"[% END %]></td>
+ <td[% IF group.minus.size > 1 %] rowspan="[% group.minus.size %]"[% END %]></td>
+ [% END %]
</tr>
[% END %]
[% current_line_old = current_line_old + 1 %]
diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl
index 291122a17..11c2804a8 100644
--- a/template/en/default/filterexceptions.pl
+++ b/template/en/default/filterexceptions.pl
@@ -432,8 +432,6 @@
'section_num',
'current_line_old',
'current_line_new',
- 'curr_old',
- 'curr_new'
],
'admin/admin.html.tmpl' => [