diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml index febac8ab11940207d08bd3b15d4910c6f53a3e4c..776d920af7f9a7c0ba37bc91f7a999a1ace0bf59 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"> </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 c2b477edfcb3c1026fa62bcc712fffaae71a9279..122343c1c1f76f8f9d90d350c5e67330a9fe1e8e 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; +}