From bb3a5bcfd7af85322dcb76229058ca21b6e1c401 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang <jp_lang@yahoo.fr>
Date: Wed, 28 Feb 2007 19:26:53 +0000
Subject: [PATCH] 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
---
 app/views/repositories/diff.rhtml | 22 ++++++++++++++--------
 public/stylesheets/scm.css        |  8 +++++++-
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml
index febac8ab1..776d920af 100644
--- a/app/views/repositories/diff.rhtml
+++ b/app/views/repositories/diff.rhtml
@@ -1,19 +1,25 @@
 <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 %>
diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css
index c2b477edf..122343c1c 100644
--- a/public/stylesheets/scm.css
+++ b/public/stylesheets/scm.css
@@ -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;
+}
-- 
GitLab