To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / common / _diff.html.erb @ 912:5e80956cc792

History | View | Annotate | Download (1.73 KB)

1 909:cbb26bc654de Chris
<% diff = Redmine::UnifiedDiff.new(
2
            diff, :type => diff_type,
3
            :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
4 441:cbce1fd3b1b7 Chris
5 0:513646585e45 Chris
<% diff.each do |table_file| -%>
6
<div class="autoscroll">
7 441:cbce1fd3b1b7 Chris
<% if diff.diff_type == 'sbs' -%>
8 0:513646585e45 Chris
<table class="filecontent">
9
<thead>
10 909:cbb26bc654de Chris
<tr>
11
  <th colspan="4" class="filename">
12
    <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
13
  </th>
14
</tr>
15 0:513646585e45 Chris
</thead>
16
<tbody>
17 441:cbce1fd3b1b7 Chris
<% table_file.each_line do |spacing, line| -%>
18
<% if spacing -%>
19 0:513646585e45 Chris
<tr class="spacing">
20 441:cbce1fd3b1b7 Chris
  <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
21
</tr>
22 0:513646585e45 Chris
<% end -%>
23
<tr>
24 441:cbce1fd3b1b7 Chris
  <th class="line-num"><%= line.nb_line_left %></th>
25
  <td class="line-code <%= line.type_diff_left %>">
26 909:cbb26bc654de Chris
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_left) %></pre>
27 0:513646585e45 Chris
  </td>
28 441:cbce1fd3b1b7 Chris
  <th class="line-num"><%= line.nb_line_right %></th>
29
  <td class="line-code <%= line.type_diff_right %>">
30 909:cbb26bc654de Chris
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_right) %></pre>
31 0:513646585e45 Chris
  </td>
32
</tr>
33
<% end -%>
34
</tbody>
35
</table>
36
37
<% else -%>
38 441:cbce1fd3b1b7 Chris
<table class="filecontent">
39 0:513646585e45 Chris
<thead>
40 909:cbb26bc654de Chris
  <tr>
41
    <th colspan="3" class="filename">
42
      <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
43
    </th>
44
  </tr>
45 0:513646585e45 Chris
</thead>
46
<tbody>
47 441:cbce1fd3b1b7 Chris
<% table_file.each_line do |spacing, line| %>
48
<% if spacing -%>
49 0:513646585e45 Chris
<tr class="spacing">
50 441:cbce1fd3b1b7 Chris
  <th class="line-num">...</th><th class="line-num">...</th><td></td>
51 0:513646585e45 Chris
</tr>
52
<% end -%>
53
<tr>
54 441:cbce1fd3b1b7 Chris
  <th class="line-num"><%= line.nb_line_left %></th>
55
  <th class="line-num"><%= line.nb_line_right %></th>
56
  <td class="line-code <%= line.type_diff %>">
57 909:cbb26bc654de Chris
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line) %></pre>
58 0:513646585e45 Chris
  </td>
59
</tr>
60
<% end -%>
61
</tbody>
62
</table>
63
<% end -%>
64
</div>
65
<% end -%>
66
67
<%= l(:text_diff_truncated) if diff.truncated? %>