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 @ 1298:4f746d8966dd

History | View | Annotate | Download (1.59 KB)

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