[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. 586148d8c8a9794efd1fdd9bef47477c4fe43aaf
Shawn Moore
sartak at bestpractical.com
Sat Feb 12 00:10:54 EST 2011
The branch, master has been updated
via 586148d8c8a9794efd1fdd9bef47477c4fe43aaf (commit)
from c120026ad8843e7778967d7b78b26d62749b0dd6 (commit)
Summary of changes:
.../RecordHistory/Mixin/Model/RecordHistory.pm | 10 +++++++++-
lib/Jifty/Plugin/RecordHistory/View.pm | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 586148d8c8a9794efd1fdd9bef47477c4fe43aaf
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Sat Feb 12 00:10:45 2011 -0500
Add a mechanism for hiding particular change_fields from view
diff --git a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
index 2860e00..3680b78 100644
--- a/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Mixin/Model/RecordHistory.pm
@@ -3,7 +3,11 @@ use strict;
use warnings;
use base 'Exporter';
-our @EXPORT = qw(changes start_change end_change current_change);
+our @EXPORT = qw(
+ changes
+ start_change end_change current_change
+ hide_change_field
+);
sub import {
my $class = shift;
@@ -133,5 +137,9 @@ sub current_change {
return $self->{change};
}
+sub hide_change_field {
+ return 0;
+}
+
1;
diff --git a/lib/Jifty/Plugin/RecordHistory/View.pm b/lib/Jifty/Plugin/RecordHistory/View.pm
index b18c50d..c89da55 100644
--- a/lib/Jifty/Plugin/RecordHistory/View.pm
+++ b/lib/Jifty/Plugin/RecordHistory/View.pm
@@ -161,6 +161,7 @@ template 'change-update' => sub {
ul {
{ class is 'change-fields' };
while (my $change_field = $change_fields->next) {
+ next if $change_field->record->hide_change_field($change_field);
show 'change_field' => $change_field;
}
};
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list