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

Shawn Moore sartak at bestpractical.com
Wed Feb 9 22:45:28 EST 2011


The branch, master has been updated
       via  ece6d2c52826cb9b145345e2277acd1f8513316d (commit)
      from  9969deb7f2ffea796ee002ada1a4c7f5b85824fc (commit)

Summary of changes:
 lib/Jifty/Plugin/RecordHistory/View.pm |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit ece6d2c52826cb9b145345e2277acd1f8513316d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 22:45:16 2011 -0500

    Refactor change ol/li to be dt/dd based on date

diff --git a/lib/Jifty/Plugin/RecordHistory/View.pm b/lib/Jifty/Plugin/RecordHistory/View.pm
index d685be9..db5749d 100644
--- a/lib/Jifty/Plugin/RecordHistory/View.pm
+++ b/lib/Jifty/Plugin/RecordHistory/View.pm
@@ -98,8 +98,15 @@ template 'changes' => sub {
         return;
     }
 
-    ol {
+    dl {
+        my $prev_date = '';
         while (my $change = $changes->next) {
+            my $date = $change->created_on->ymd;
+            if ($date ne $prev_date) {
+                dt { $date };
+                $prev_date = $date;
+            }
+
             show 'change' => $change;
         }
     };
@@ -111,7 +118,7 @@ template 'change' => sub {
 
     my $template = 'change-' . $change->type;
 
-    li { show $template => $change };
+    dd { show $template => $change };
 };
 
 template 'change-create' => sub {

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



More information about the Bps-public-commit mailing list