[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. 0.05-12-g4c83777

Shawn Moore sartak at bestpractical.com
Sat Feb 26 21:38:46 EST 2011


The branch, master has been updated
       via  4c8377793125b10684762b256b246627d1a17101 (commit)
      from  00d0403d5c9a8b7d6de8ed3523b15e8b8c0bfacc (commit)

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

- Log -----------------------------------------------------------------
commit 4c8377793125b10684762b256b246627d1a17101
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sat Feb 26 21:38:26 2011 -0500

    Factor out change-update so authors can reuse the change-field template

diff --git a/lib/Jifty/Plugin/RecordHistory/View.pm b/lib/Jifty/Plugin/RecordHistory/View.pm
index 71a45a3..33bbdc8 100644
--- a/lib/Jifty/Plugin/RecordHistory/View.pm
+++ b/lib/Jifty/Plugin/RecordHistory/View.pm
@@ -159,13 +159,25 @@ template 'change-update' => sub {
     my $change_fields = $change->change_fields;
     return if !$change_fields->count;
 
-    my $record = $change->record;
+    show 'change-update-record' => $change;
+    show 'change-update-fields' => $change;
+};
 
+template 'change-update-record' => sub {
+    my $self   = shift;
+    my $change = shift;
     span {
-        show 'record_type' => $record;
+        show 'record_type' => $change->record;
         outs _(' updated by ');
         show 'actor' => $change->created_by;
     };
+};
+
+template 'change-update-fields' => sub {
+    my $self   = shift;
+    my $change = shift;
+
+    my $record = $change->record;
 
     my @change_fields = grep { !$record->hide_change_field($_) }
                         @{ $change->change_fields->items_array_ref };

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



More information about the Bps-public-commit mailing list