From 9511ec846d39ff57aca6ea2e82da47f04477078c Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Sun, 12 Feb 2012 00:29:16 +0200
Subject: [PATCH] improved diff, restyled login page

---
 app/assets/stylesheets/commits.css.scss | 6 +++++-
 app/assets/stylesheets/login.scss       | 5 ++++-
 app/helpers/commits_helper.rb           | 2 +-
 app/views/commits/_text_file.html.haml  | 2 +-
 app/views/commits/show.html.haml        | 2 ++
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/app/assets/stylesheets/commits.css.scss b/app/assets/stylesheets/commits.css.scss
index 691b3d86eb5..6ab9d19b951 100644
--- a/app/assets/stylesheets/commits.css.scss
+++ b/app/assets/stylesheets/commits.css.scss
@@ -75,11 +75,15 @@
     padding:0px;
     border:none;
     &.new { 
-      background: #DFD;
+      background: #CFD;
     }
     &.old { 
       background: #FDD;
     }
+    &.matched { 
+      color:#ccc;
+      background:#fafafa;
+    }
   }
 }
 
diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss
index 73ba27ee2d1..566ebbeca33 100644
--- a/app/assets/stylesheets/login.scss
+++ b/app/assets/stylesheets/login.scss
@@ -1,5 +1,8 @@
 /* Login Page */
-body.login-page{ padding-top: 10%}
+body.login-page{ 
+  padding-top: 10%;
+  background:$style_color;
+}
 
 .login-box{
   width: 304px;
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index b56fce17bf9..c56874af2b8 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -65,7 +65,7 @@ module CommitsHelper
         line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
         line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
 
-        yield(nil, type, nil, nil, nil)
+        yield(line, type, nil, nil, nil)
         next
       else
         type = diff_line_class(line)
diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml
index bff578c0e44..609a454a1c6 100644
--- a/app/views/commits/_text_file.html.haml
+++ b/app/views/commits/_text_file.html.haml
@@ -4,7 +4,7 @@
     - if type == "match"
       %td.old_line= "..."
       %td.new_line= "..."
-      %td.line_content &nbsp;
+      %td.line_content.matched= line
     - else 
       %td.old_line= link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", :id => line_code
       %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", :id => line_code
diff --git a/app/views/commits/show.html.haml b/app/views/commits/show.html.haml
index 4d142537879..26e89515b29 100644
--- a/app/views/commits/show.html.haml
+++ b/app/views/commits/show.html.haml
@@ -13,6 +13,8 @@
 .clear
 %br
 
+%p.cgray
+  Showing #{pluralize(@commit.diffs.count, "changed file")}
 = render "commits/diffs", :diffs => @commit.diffs
 = render "notes/notes"
 = render "notes/per_line_form"
-- 
2.30.9