OSDN Git Service

improved diff, restyled login page
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Sat, 11 Feb 2012 22:29:16 +0000 (00:29 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Sat, 11 Feb 2012 22:29:16 +0000 (00:29 +0200)
app/assets/stylesheets/commits.css.scss
app/assets/stylesheets/login.scss
app/helpers/commits_helper.rb
app/views/commits/_text_file.html.haml
app/views/commits/show.html.haml

index 691b3d8..6ab9d19 100644 (file)
     padding:0px;
     border:none;
     &.new { 
-      background: #DFD;
+      background: #CFD;
     }
     &.old { 
       background: #FDD;
     }
+    &.matched { 
+      color:#ccc;
+      background:#fafafa;
+    }
   }
 }
 
index 73ba27e..566ebbe 100644 (file)
@@ -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;
index b56fce1..c56874a 100644 (file)
@@ -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)
index bff578c..609a454 100644 (file)
@@ -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
index 4d14253..26e8951 100644 (file)
@@ -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"