[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [%# 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. # Also, the first empty row is required because 'table-layout: fixed' only # considers the first row to determine column widths. If a colspan is found, # it then share the width equally among all columns, which we don't want. #%] [% section_num = 0 %] [% FOREACH section = sections %] [% section_num = section_num + 1 %] [% current_line_old = section.old_start %] [% current_line_new = section.new_start %] [% FOREACH group = section.groups %] [% IF group.context %] [% FOREACH line = group.context %] [% current_line_old = current_line_old + 1 %] [% current_line_new = current_line_new + 1 %] [% END %] [% END %] [% IF group.plus.size %] [% IF group.minus.size %] [% i = 0 %] [% 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) %] [% IF i < group.minus.size %] [% ELSIF i == group.minus.size %] [% rowspan = group.plus.size - group.minus.size %] [% END %] [% IF i < group.plus.size %] [% ELSIF i == group.plus.size %] [% rowspan = group.minus.size - group.plus.size %] [% END %] [% currentloop = currentloop + 1 %] [% i = i + 1 %] [% END %] [% END %] [% current_line_old = current_line_old + group.minus.size %] [% current_line_new = current_line_new + group.plus.size %] [% ELSE %] [% FOREACH line = group.plus %] [% IF file.is_add %] [% ELSE %] [% IF loop.first %] 1 %] rowspan="[% group.plus.size %]"[% END %]> [% END %] [% END %] [% current_line_new = current_line_new + 1 %] [% END %] [% END %] [% ELSE %] [% IF group.minus.size %] [% FOREACH line = group.minus %] [% IF file.is_remove %] [% ELSE %] [% IF loop.first %] 1 %] rowspan="[% group.minus.size %]"[% END %]> [% END %] [% END %] [% current_line_old = current_line_old + 1 %] [% END %] [% END %] [% END %] [% END %] [% END %]
[% collapsed ? '(+)' : '(-)' %] [% file.filename FILTER html %] [% IF file.plus_lines %] [% IF file.minus_lines %] (-[% file.minus_lines %] / +[% file.plus_lines %] lines) [% ELSE %] (+[% file.plus_lines %] lines) [% END %] [% ELSE %] [% IF file.minus_lines %] (-[% file.minus_lines %] lines) [% END %] [% END %]