Commit bb3a5bcf authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

patch #8937: Show filename above diff to aid reading multi-file diffs

git-svn-id: http://redmine.rubyforge.org/svn/trunk@282 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 35678a1c
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<table class="list">
<thead><tr><th>@<%= @rev %></th><th>@<%= @rev_to %></th><th></th></tr></thead>
<tbody>
<% parsing = false
line_num_l = 0
line_num_r = 0 %>
<% @diff.each do |line| %>
<%
if line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/
if line =~ /^Index: (.*)$/
if parsing %>
</tbody></table>
<%
end
parsing = false %>
<table class="list"><thead>
<tr><th colspan="3" class="list-filename"><%= l(:label_attachment) %>: <%= $1 %></th></tr>
<tr><th>@<%= @rev %></th><th>@<%= @rev_to %></th><th></th></tr>
</thead><tbody>
<%
next
elsif line =~ /^@@ (\+|\-)(\d+)(,\d+)? (\+|\-)(\d+)(,\d+)? @@/
line_num_l = $2.to_i
line_num_r = $5.to_i
if parsing %>
<tr class="spacing"><td colspan="3">&nbsp;</td></tr>
<% end
parsing = true
next
end
......@@ -54,4 +60,4 @@ line_num_r = 0 %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
\ No newline at end of file
<% end %>
......@@ -19,4 +19,10 @@ tr.spacing {
.line-code {
font-family: "Courier New", monospace;
font-size: 1em;
}
\ No newline at end of file
}
table.list thead th.list-filename {
background-color: #ddc;
font-weight: bolder;
text-align: left;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment