@@ -11,50 +11,43 | |||||
11 | <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p> |
|
11 | <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p> | |
12 | <% end %> |
|
12 | <% end %> | |
13 |
|
13 | |||
14 | <% cache(@cache_key) do %> |
|
14 | <% cache(@cache_key) do -%> | |
15 | <% @diff.each do |table_file| %> |
|
15 | <% @diff.each do |table_file| -%> | |
16 | <div class="autoscroll"> |
|
16 | <div class="autoscroll"> | |
17 | <% if @diff_type == 'sbs' %> |
|
17 | <% if @diff_type == 'sbs' -%> | |
18 |
|
|
18 | <table class="filecontent CodeRay"> | |
19 |
|
|
19 | <thead> | |
20 | <tr> |
|
20 | <tr><th colspan="4" class="filename"><%= table_file.file_name %></th></tr> | |
21 | <th colspan="4" class="filename"> |
|
|||
22 | <%= table_file.file_name %> |
|
|||
23 | </th> |
|
|||
24 | </tr> |
|
|||
25 | <tr> |
|
21 | <tr> | |
26 |
|
|
22 | <th colspan="2">@<%= format_revision @rev %></th> | |
27 |
|
|
23 | <th colspan="2">@<%= format_revision @rev_to %></th> | |
28 | </tr> |
|
24 | </tr> | |
29 |
|
|
25 | </thead> | |
30 |
|
|
26 | <tbody> | |
31 | <% table_file.keys.sort.each do |key| %> |
|
27 | <% prev_line_left, prev_line_right = nil, nil -%> | |
|
28 | <% table_file.keys.sort.each do |key| -%> | |||
|
29 | <% 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) -%> | |||
|
30 | <tr class="spacing"><td colspan="4"></td></tr> | |||
|
31 | <% end -%> | |||
32 | <tr> |
|
32 | <tr> | |
33 | <th class="line-num"> |
|
33 | <th class="line-num"><%= table_file[key].nb_line_left %></th> | |
34 | <%= table_file[key].nb_line_left %> |
|
|||
35 | </th> |
|
|||
36 |
|
|
34 | <td class="line-code <%= table_file[key].type_diff_left %>"> | |
37 |
|
|
35 | <pre><%=to_utf8 table_file[key].line_left %></pre> | |
38 | </td> |
|
36 | </td> | |
39 | <th class="line-num"> |
|
37 | <th class="line-num"><%= table_file[key].nb_line_right %></th> | |
40 | <%= table_file[key].nb_line_right %> |
|
|||
41 | </th> |
|
|||
42 |
|
|
38 | <td class="line-code <%= table_file[key].type_diff_right %>"> | |
43 |
|
|
39 | <pre><%=to_utf8 table_file[key].line_right %></pre> | |
44 | </td> |
|
40 | </td> | |
45 | </tr> |
|
41 | </tr> | |
46 | <% end %> |
|
42 | <% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%> | |
|
43 | <% end -%> | |||
47 |
|
|
44 | </tbody> | |
48 |
|
|
45 | </table> | |
49 |
|
46 | |||
50 | <% else %> |
|
47 | <% else -%> | |
51 |
|
|
48 | <table class="filecontent CodeRay"> | |
52 |
|
|
49 | <thead> | |
53 | <tr> |
|
50 | <tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr> | |
54 | <th colspan="3" class="filename"> |
|
|||
55 | <%= table_file.file_name %> |
|
|||
56 | </th> |
|
|||
57 | </tr> |
|
|||
58 | <tr> |
|
51 | <tr> | |
59 |
|
|
52 | <th>@<%= format_revision @rev %></th> | |
60 |
|
|
53 | <th>@<%= format_revision @rev_to %></th> | |
@@ -62,31 +55,34 | |||||
62 | </tr> |
|
55 | </tr> | |
63 |
|
|
56 | </thead> | |
64 |
|
|
57 | <tbody> | |
|
58 | <% prev_line_left, prev_line_right = nil, nil -%> | |||
65 |
|
|
59 | <% table_file.keys.sort.each do |key, line| %> | |
|
60 | <% 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) -%> | |||
|
61 | <tr class="spacing"><td colspan="3"></td></tr> | |||
|
62 | <% end -%> | |||
66 | <tr> |
|
63 | <tr> | |
67 | <th class="line-num"> |
|
64 | <th class="line-num"><%= table_file[key].nb_line_left %></th> | |
68 |
|
|
65 | <th class="line-num"><%= table_file[key].nb_line_right %></th> | |
69 | </th> |
|
66 | <% if table_file[key].line_left.empty? -%> | |
70 | <th class="line-num"> |
|
|||
71 | <%= table_file[key].nb_line_right %> |
|
|||
72 | </th> |
|
|||
73 | <% if table_file[key].line_left.empty? %> |
|
|||
74 |
|
|
67 | <td class="line-code <%= table_file[key].type_diff_right %>"> | |
75 |
|
|
68 | <pre><%=to_utf8 table_file[key].line_right %></pre> | |
76 | </td> |
|
69 | </td> | |
77 |
|
|
70 | <% else -%> | |
78 |
|
|
71 | <td class="line-code <%= table_file[key].type_diff_left %>"> | |
79 |
|
|
72 | <pre><%=to_utf8 table_file[key].line_left %></pre> | |
80 | </td> |
|
73 | </td> | |
81 |
|
|
74 | <% end -%> | |
82 | </tr> |
|
75 | </tr> | |
83 | <% end %> |
|
76 | <% prev_line_left = table_file[key].nb_line_left.to_i if table_file[key].nb_line_left.to_i > 0 -%> | |
|
77 | <% prev_line_right = table_file[key].nb_line_right.to_i if table_file[key].nb_line_right.to_i > 0 -%> | |||
|
78 | <% end -%> | |||
84 |
|
|
79 | </tbody> | |
85 |
|
|
80 | </table> | |
86 | <% end %> |
|
81 | <% end -%> | |
|
82 | ||||
87 | </div> |
|
83 | </div> | |
88 | <% end %> |
|
84 | <% end -%> | |
89 | <% end %> |
|
85 | <% end -%> | |
90 |
|
86 | |||
91 | <% html_title(with_leading_slash(@path), 'Diff') -%> |
|
87 | <% html_title(with_leading_slash(@path), 'Diff') -%> | |
92 |
|
88 |
@@ -2,7 +2,7 | |||||
2 | table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; } |
|
2 | table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; } | |
3 | table.filecontent th { border: 1px solid #ccc; background-color: #eee; } |
|
3 | table.filecontent th { border: 1px solid #ccc; background-color: #eee; } | |
4 | table.filecontent th.filename { background-color: #ddc; text-align: left; } |
|
4 | table.filecontent th.filename { background-color: #ddc; text-align: left; } | |
5 | table.filecontent tr.spacing { border: 1px solid #d7d7d7; } |
|
5 | table.filecontent tr.spacing td { border: 1px solid #d7d7d7; height: 0.4em; } | |
6 | table.filecontent th.line-num { |
|
6 | table.filecontent th.line-num { | |
7 | border: 1px solid #d7d7d7; |
|
7 | border: 1px solid #d7d7d7; | |
8 | font-size: 0.8em; |
|
8 | font-size: 0.8em; |
General Comments 0
You need to be logged in to leave comments.
Login now