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