@@ -11,82 +11,78 | |||||
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"> |
|
21 | <tr> | |
22 | <%= table_file.file_name %> |
|
22 | <th colspan="2">@<%= format_revision @rev %></th> | |
23 | </th> |
|
23 | <th colspan="2">@<%= format_revision @rev_to %></th> | |
24 | </tr> |
|
24 | </tr> | |
25 | <tr> |
|
25 | </thead> | |
26 | <th colspan="2">@<%= format_revision @rev %></th> |
|
26 | <tbody> | |
27 | <th colspan="2">@<%= format_revision @rev_to %></th> |
|
27 | <% prev_line_left, prev_line_right = nil, nil -%> | |
28 | </tr> |
|
28 | <% table_file.keys.sort.each do |key| -%> | |
29 | </thead> |
|
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 | <tbody> |
|
30 | <tr class="spacing"><td colspan="4"></td></tr> | |
31 | <% table_file.keys.sort.each do |key| %> |
|
31 | <% end -%> | |
32 | <tr> |
|
32 | <tr> | |
33 | <th class="line-num"> |
|
33 | <th class="line-num"><%= table_file[key].nb_line_left %></th> | |
34 |
|
|
34 | <td class="line-code <%= table_file[key].type_diff_left %>"> | |
35 | </th> |
|
35 | <pre><%=to_utf8 table_file[key].line_left %></pre> | |
36 | <td class="line-code <%= table_file[key].type_diff_left %>"> |
|
36 | </td> | |
37 | <pre><%=to_utf8 table_file[key].line_left %></pre> |
|
37 | <th class="line-num"><%= table_file[key].nb_line_right %></th> | |
38 | </td> |
|
38 | <td class="line-code <%= table_file[key].type_diff_right %>"> | |
39 | <th class="line-num"> |
|
39 | <pre><%=to_utf8 table_file[key].line_right %></pre> | |
40 | <%= table_file[key].nb_line_right %> |
|
40 | </td> | |
41 | </th> |
|
41 | </tr> | |
42 | <td class="line-code <%= table_file[key].type_diff_right %>"> |
|
42 | <% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%> | |
43 | <pre><%=to_utf8 table_file[key].line_right %></pre> |
|
43 | <% end -%> | |
44 | </td> |
|
44 | </tbody> | |
45 | </tr> |
|
45 | </table> | |
46 | <% end %> |
|
46 | ||
47 | </tbody> |
|
47 | <% else -%> | |
48 | </table> |
|
48 | <table class="filecontent CodeRay"> | |
|
49 | <thead> | |||
|
50 | <tr><th colspan="3" class="filename"><%= table_file.file_name %></th></tr> | |||
|
51 | <tr> | |||
|
52 | <th>@<%= format_revision @rev %></th> | |||
|
53 | <th>@<%= format_revision @rev_to %></th> | |||
|
54 | <th></th> | |||
|
55 | </tr> | |||
|
56 | </thead> | |||
|
57 | <tbody> | |||
|
58 | <% prev_line_left, prev_line_right = nil, nil -%> | |||
|
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 -%> | |||
|
63 | <tr> | |||
|
64 | <th class="line-num"><%= table_file[key].nb_line_left %></th> | |||
|
65 | <th class="line-num"><%= table_file[key].nb_line_right %></th> | |||
|
66 | <% if table_file[key].line_left.empty? -%> | |||
|
67 | <td class="line-code <%= table_file[key].type_diff_right %>"> | |||
|
68 | <pre><%=to_utf8 table_file[key].line_right %></pre> | |||
|
69 | </td> | |||
|
70 | <% else -%> | |||
|
71 | <td class="line-code <%= table_file[key].type_diff_left %>"> | |||
|
72 | <pre><%=to_utf8 table_file[key].line_left %></pre> | |||
|
73 | </td> | |||
|
74 | <% end -%> | |||
|
75 | </tr> | |||
|
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 -%> | |||
|
79 | </tbody> | |||
|
80 | </table> | |||
|
81 | <% end -%> | |||
49 |
|
82 | |||
50 | <% else %> |
|
|||
51 | <table class="filecontent CodeRay"> |
|
|||
52 | <thead> |
|
|||
53 | <tr> |
|
|||
54 | <th colspan="3" class="filename"> |
|
|||
55 | <%= table_file.file_name %> |
|
|||
56 | </th> |
|
|||
57 | </tr> |
|
|||
58 | <tr> |
|
|||
59 | <th>@<%= format_revision @rev %></th> |
|
|||
60 | <th>@<%= format_revision @rev_to %></th> |
|
|||
61 | <th></th> |
|
|||
62 | </tr> |
|
|||
63 | </thead> |
|
|||
64 | <tbody> |
|
|||
65 | <% table_file.keys.sort.each do |key, line| %> |
|
|||
66 | <tr> |
|
|||
67 | <th class="line-num"> |
|
|||
68 | <%= table_file[key].nb_line_left %> |
|
|||
69 | </th> |
|
|||
70 | <th class="line-num"> |
|
|||
71 | <%= table_file[key].nb_line_right %> |
|
|||
72 | </th> |
|
|||
73 | <% if table_file[key].line_left.empty? %> |
|
|||
74 | <td class="line-code <%= table_file[key].type_diff_right %>"> |
|
|||
75 | <pre><%=to_utf8 table_file[key].line_right %></pre> |
|
|||
76 | </td> |
|
|||
77 | <% else %> |
|
|||
78 | <td class="line-code <%= table_file[key].type_diff_left %>"> |
|
|||
79 | <pre><%=to_utf8 table_file[key].line_left %></pre> |
|
|||
80 | </td> |
|
|||
81 | <% end %> |
|
|||
82 | </tr> |
|
|||
83 | <% end %> |
|
|||
84 | </tbody> |
|
|||
85 | </table> |
|
|||
86 | <% end %> |
|
|||
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