@@ -1,74 +1,61 | |||
|
1 | 1 | <% Redmine::UnifiedDiff.new(diff, diff_type).each do |table_file| -%> |
|
2 | 2 | <div class="autoscroll"> |
|
3 | 3 | <% if diff_type == 'sbs' -%> |
|
4 | 4 | <table class="filecontent CodeRay"> |
|
5 | 5 | <thead> |
|
6 | 6 | <tr><th colspan="4" class="filename"><%= table_file.file_name %></th></tr> |
|
7 | <% unless @rev.nil? -%> | |
|
8 | <tr> | |
|
9 | <th colspan="2">@<%= format_revision @rev %></th> | |
|
10 | <th colspan="2">@<%= format_revision @rev_to %></th> | |
|
11 | </tr> | |
|
12 | <% end -%> | |
|
13 | 7 | </thead> |
|
14 | 8 | <tbody> |
|
15 | 9 | <% prev_line_left, prev_line_right = nil, nil -%> |
|
16 | 10 | <% table_file.keys.sort.each do |key| -%> |
|
17 | 11 | <% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%> |
|
18 | 12 | <tr class="spacing"><td colspan="4"></td></tr> |
|
19 | 13 | <% end -%> |
|
20 | 14 | <tr> |
|
21 | 15 | <th class="line-num"><%= table_file[key].nb_line_left %></th> |
|
22 | 16 | <td class="line-code <%= table_file[key].type_diff_left %>"> |
|
23 | 17 | <pre><%=to_utf8 table_file[key].line_left %></pre> |
|
24 | 18 | </td> |
|
25 | 19 | <th class="line-num"><%= table_file[key].nb_line_right %></th> |
|
26 | 20 | <td class="line-code <%= table_file[key].type_diff_right %>"> |
|
27 | 21 | <pre><%=to_utf8 table_file[key].line_right %></pre> |
|
28 | 22 | </td> |
|
29 | 23 | </tr> |
|
30 | 24 | <% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%> |
|
31 | 25 | <% end -%> |
|
32 | 26 | </tbody> |
|
33 | 27 | </table> |
|
34 | 28 | |
|
35 | 29 | <% else -%> |
|
36 | 30 | <table class="filecontent CodeRay"> |
|
37 | 31 | <thead> |
|
38 | 32 | <tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr> |
|
39 | <% unless @rev.nil? -%> | |
|
40 | <tr> | |
|
41 | <th>@<%= format_revision @rev %></th> | |
|
42 | <th>@<%= format_revision @rev_to %></th> | |
|
43 | <th></th> | |
|
44 | </tr> | |
|
45 | <% end -%> | |
|
46 | 33 | </thead> |
|
47 | 34 | <tbody> |
|
48 | 35 | <% prev_line_left, prev_line_right = nil, nil -%> |
|
49 | 36 | <% table_file.keys.sort.each do |key, line| %> |
|
50 | 37 | <% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%> |
|
51 | 38 | <tr class="spacing"><td colspan="3"></td></tr> |
|
52 | 39 | <% end -%> |
|
53 | 40 | <tr> |
|
54 | 41 | <th class="line-num"><%= table_file[key].nb_line_left %></th> |
|
55 | 42 | <th class="line-num"><%= table_file[key].nb_line_right %></th> |
|
56 | 43 | <% if table_file[key].line_left.empty? -%> |
|
57 | 44 | <td class="line-code <%= table_file[key].type_diff_right %>"> |
|
58 | 45 | <pre><%=to_utf8 table_file[key].line_right %></pre> |
|
59 | 46 | </td> |
|
60 | 47 | <% else -%> |
|
61 | 48 | <td class="line-code <%= table_file[key].type_diff_left %>"> |
|
62 | 49 | <pre><%=to_utf8 table_file[key].line_left %></pre> |
|
63 | 50 | </td> |
|
64 | 51 | <% end -%> |
|
65 | 52 | </tr> |
|
66 | 53 | <% prev_line_left = table_file[key].nb_line_left.to_i if table_file[key].nb_line_left.to_i > 0 -%> |
|
67 | 54 | <% prev_line_right = table_file[key].nb_line_right.to_i if table_file[key].nb_line_right.to_i > 0 -%> |
|
68 | 55 | <% end -%> |
|
69 | 56 | </tbody> |
|
70 | 57 | </table> |
|
71 | 58 | <% end -%> |
|
72 | 59 | |
|
73 | 60 | </div> |
|
74 | 61 | <% end -%> |
General Comments 0
You need to be logged in to leave comments.
Login now