[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. d90773ec96f0b4f18b4021fae1cbf76c3d57b2ec

Shawn Moore sartak at bestpractical.com
Mon Feb 14 23:03:02 EST 2011


The branch, master has been updated
       via  d90773ec96f0b4f18b4021fae1cbf76c3d57b2ec (commit)
      from  5371c54c9b45e89f5d34a220c58845c4de9487cc (commit)

Summary of changes:
 lib/Jifty/Plugin/RecordHistory/View.pm  |   20 ++++++++++++++++----
 share/web/static/css/record-history.css |    5 +++++
 2 files changed, 21 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit d90773ec96f0b4f18b4021fae1cbf76c3d57b2ec
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Feb 14 23:02:52 2011 -0500

    Display undef as italicized (no value)

diff --git a/lib/Jifty/Plugin/RecordHistory/View.pm b/lib/Jifty/Plugin/RecordHistory/View.pm
index 0fd23b0..9fe8810 100644
--- a/lib/Jifty/Plugin/RecordHistory/View.pm
+++ b/lib/Jifty/Plugin/RecordHistory/View.pm
@@ -191,13 +191,25 @@ template 'change_field' => sub {
         };
         outs " changed from ";
         span {
-            class is 'old-value';
-            outs $old;
+            if (!defined($old)) {
+                class is 'old-value no-value';
+                outs '(no value)';
+            }
+            else {
+                class is 'old-value';
+                outs $old;
+            }
         };
         outs " to ";
         span {
-            class is 'new-value';
-            outs $new;
+            if (!defined($new)) {
+                class is 'new-value no-value';
+                outs '(no value)';
+            }
+            else {
+                class is 'new-value';
+                outs $new;
+            }
         };
     };
 };
diff --git a/share/web/static/css/record-history.css b/share/web/static/css/record-history.css
index db787bd..d85fad7 100644
--- a/share/web/static/css/record-history.css
+++ b/share/web/static/css/record-history.css
@@ -5,3 +5,8 @@
 .change-field .old-value, .change-field .new-value {
     font-weight: bold;
 }
+
+.change-field .no-value {
+    font-style: italic;
+}
+

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



More information about the Bps-public-commit mailing list