comparison app/views/common/.svn/text-base/_diff.rhtml.svn-base @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 8661b858af72
children
comparison
equal deleted inserted replaced
245:051f544170fe 441:cbce1fd3b1b7
1 <% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%> 1 <% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
2
2 <% diff.each do |table_file| -%> 3 <% diff.each do |table_file| -%>
3 <div class="autoscroll"> 4 <div class="autoscroll">
4 <% if diff_type == 'sbs' -%> 5 <% if diff.diff_type == 'sbs' -%>
5 <table class="filecontent"> 6 <table class="filecontent">
6 <thead> 7 <thead>
7 <tr><th colspan="4" class="filename"><%=to_utf8 table_file.file_name %></th></tr> 8 <tr><th colspan="4" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
8 </thead> 9 </thead>
9 <tbody> 10 <tbody>
10 <% prev_line_left, prev_line_right = nil, nil -%> 11 <% table_file.each_line do |spacing, line| -%>
11 <% table_file.keys.sort.each do |key| -%> 12 <% if spacing -%>
12 <% 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) -%>
13 <tr class="spacing"> 13 <tr class="spacing">
14 <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td> 14 <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
15 </tr>
15 <% end -%> 16 <% end -%>
16 <tr> 17 <tr>
17 <th class="line-num"><%= table_file[key].nb_line_left %></th> 18 <th class="line-num"><%= line.nb_line_left %></th>
18 <td class="line-code <%= table_file[key].type_diff_left %>"> 19 <td class="line-code <%= line.type_diff_left %>">
19 <pre><%=to_utf8 table_file[key].line_left %></pre> 20 <pre><%=to_utf8 line.html_line_left %></pre>
20 </td> 21 </td>
21 <th class="line-num"><%= table_file[key].nb_line_right %></th> 22 <th class="line-num"><%= line.nb_line_right %></th>
22 <td class="line-code <%= table_file[key].type_diff_right %>"> 23 <td class="line-code <%= line.type_diff_right %>">
23 <pre><%=to_utf8 table_file[key].line_right %></pre> 24 <pre><%=to_utf8 line.html_line_right %></pre>
24 </td> 25 </td>
25 </tr> 26 </tr>
26 <% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%>
27 <% end -%> 27 <% end -%>
28 </tbody> 28 </tbody>
29 </table> 29 </table>
30 30
31 <% else -%> 31 <% else -%>
32 <table class="filecontent syntaxhl"> 32 <table class="filecontent">
33 <thead> 33 <thead>
34 <tr><th colspan="3" class="filename"><%=to_utf8 table_file.file_name %></th></tr> 34 <tr><th colspan="3" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
35 </thead> 35 </thead>
36 <tbody> 36 <tbody>
37 <% prev_line_left, prev_line_right = nil, nil -%> 37 <% table_file.each_line do |spacing, line| %>
38 <% table_file.keys.sort.each do |key, line| %> 38 <% if spacing -%>
39 <% 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) -%>
40 <tr class="spacing"> 39 <tr class="spacing">
41 <th class="line-num">...</th><th class="line-num">...</th><td></td> 40 <th class="line-num">...</th><th class="line-num">...</th><td></td>
42 </tr> 41 </tr>
43 <% end -%> 42 <% end -%>
44 <tr> 43 <tr>
45 <th class="line-num"><%= table_file[key].nb_line_left %></th> 44 <th class="line-num"><%= line.nb_line_left %></th>
46 <th class="line-num"><%= table_file[key].nb_line_right %></th> 45 <th class="line-num"><%= line.nb_line_right %></th>
47 <% if table_file[key].line_left.empty? -%> 46 <td class="line-code <%= line.type_diff %>">
48 <td class="line-code <%= table_file[key].type_diff_right %>"> 47 <pre><%=to_utf8 line.html_line %></pre>
49 <pre><%=to_utf8 table_file[key].line_right %></pre>
50 </td> 48 </td>
51 <% else -%>
52 <td class="line-code <%= table_file[key].type_diff_left %>">
53 <pre><%=to_utf8 table_file[key].line_left %></pre>
54 </td>
55 <% end -%>
56 </tr> 49 </tr>
57 <% prev_line_left = table_file[key].nb_line_left.to_i if table_file[key].nb_line_left.to_i > 0 -%>
58 <% prev_line_right = table_file[key].nb_line_right.to_i if table_file[key].nb_line_right.to_i > 0 -%>
59 <% end -%> 50 <% end -%>
60 </tbody> 51 </tbody>
61 </table> 52 </table>
62 <% end -%> 53 <% end -%>
63
64 </div> 54 </div>
65 <% end -%> 55 <% end -%>
66 56
67 <%= l(:text_diff_truncated) if diff.truncated? %> 57 <%= l(:text_diff_truncated) if diff.truncated? %>