[Bps-public-commit] App-Changeloggr branch, master, updated. e47b6fd72f464233d4f2f8bf1f63c08f35d0c00c

sartak at bestpractical.com sartak at bestpractical.com
Wed Apr 29 12:19:47 EDT 2009


The branch, master has been updated
       via  e47b6fd72f464233d4f2f8bf1f63c08f35d0c00c (commit)
      from  d2ddc1975f088ee94e6dd1ba9637f9cc0719e5ea (commit)

Summary of changes:
 lib/App/Changeloggr/View.pm  |    6 +++++-
 share/web/static/css/app.css |   18 +++++++++++++-----
 2 files changed, 18 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit e47b6fd72f464233d4f2f8bf1f63c08f35d0c00c
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed Apr 29 12:18:42 2009 -0400

    Color the diffstat +s and -s

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 20aa797..ed4b675 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -125,7 +125,11 @@ template '/change/more' => sub {
     my $change = M('Change', id => get('change'));
 
     pre {
-        $change->diffstat;
+        my $diffstat = Jifty->web->escape($change->diffstat);
+        $diffstat =~ s{(\++)}{<span class="diffadd">$1</span>}g;
+        $diffstat =~ s{(\-+)}{<span class="diffsub">$1</span>}g;
+
+        outs_raw $diffstat;
     };
 };
 
diff --git a/share/web/static/css/app.css b/share/web/static/css/app.css
index 8b7dac7..85f8d78 100644
--- a/share/web/static/css/app.css
+++ b/share/web/static/css/app.css
@@ -82,13 +82,21 @@ dl.keybindings dd {
 }
 
 ul.change_metadata {
-    list-style-type: none;
-    font-size: .8em;
-    padding-left: 0;
+   list-style-type: none;
+   font-size: .8em;
+   padding-left: 0;
 }
 
 hr {
-    border: 0;
-    border-bottom: 1px dashed #333;
+   border: 0;
+   border-bottom: 1px dashed #333;
+}
+
+.diffadd {
+   color: #9f9;
+}
+
+.diffsub {
+   color: #f99;
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list