From 677b3a96fb73d9558ddda0cc9a21d9b94421ab5d Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 9 Jul 2009 15:46:53 +0000 Subject: Bug 352615: Group empty cells together to reduce the size of the diff page - Patch by Frédéric Buclin a=LpSolit (module owner) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/en/default/attachment/diff-file.html.tmpl | 42 +++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'template/en/default/attachment') 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 + # Frédéric Buclin #%] [%# 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) %] - [% curr_old %] + [% IF i < group.minus.size %] + [% current_line_old + i %]
[% group.minus.$i FILTER html %]
- [% curr_new %] + [% ELSIF i == group.minus.size %] + [% rowspan = group.plus.size - group.minus.size %] + 1 %] rowspan="[% rowspan FILTER none %]"[% END %]> + 1 %] rowspan="[% rowspan FILTER none %]"[% END %]> + [% END %] + + [% IF i < group.plus.size %] + [% current_line_new + i %]
[% group.plus.$i FILTER html %]
+ [% ELSIF i == group.plus.size %] + [% rowspan = group.minus.size - group.plus.size %] + 1 %] rowspan="[% rowspan FILTER none %]"[% END %]> + 1 %] rowspan="[% rowspan FILTER none %]"[% END %]> + [% END %] [% 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() [% ELSE %] - + [% IF loop.first %] + 1 %] rowspan="[% group.plus.size %]"[% END %]> + 1 %] rowspan="[% group.plus.size %]"[% END %]> + [% END %] [% current_line_new %]
[% line FILTER html %]
@@ -156,7 +161,10 @@ incremental_restore() [% current_line_old %]
[% line FILTER html %]
- + [% IF loop.first %] + 1 %] rowspan="[% group.minus.size %]"[% END %]> + 1 %] rowspan="[% group.minus.size %]"[% END %]> + [% END %] [% END %] [% current_line_old = current_line_old + 1 %] -- cgit v1.2.3-24-g4f1b