You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_diff.html.erb 1.9KB

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