[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. cfc49c35e6402a565255cc681b7d47393a303a87
Shawn Moore
sartak at bestpractical.com
Mon Feb 14 15:51:53 EST 2011
The branch, master has been updated
via cfc49c35e6402a565255cc681b7d47393a303a87 (commit)
via 662d084da63c61d63d67960d214f1b2d4850e12f (commit)
via 799206853d846d0eb16606cd7c6bf92414ad29f6 (commit)
from e3e3ba8677e8b18a43e9796f30f680b0864d009d (commit)
Summary of changes:
Makefile.PL | 1 +
inc/Module/Install/Share.pm | 96 +++++++++++++++++++++++++++++++
lib/Jifty/Plugin/RecordHistory.pm | 4 +
lib/Jifty/Plugin/RecordHistory/View.pm | 5 +-
share/web/static/css/record-history.css | 7 ++
5 files changed, 110 insertions(+), 3 deletions(-)
create mode 100644 inc/Module/Install/Share.pm
create mode 100644 share/web/static/css/record-history.css
- Log -----------------------------------------------------------------
commit 799206853d846d0eb16606cd7c6bf92414ad29f6
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Feb 14 15:50:34 2011 -0500
Remove quotes, they don't work well with whitespace, css will work better
diff --git a/lib/Jifty/Plugin/RecordHistory/View.pm b/lib/Jifty/Plugin/RecordHistory/View.pm
index 0a2fab5..0fd23b0 100644
--- a/lib/Jifty/Plugin/RecordHistory/View.pm
+++ b/lib/Jifty/Plugin/RecordHistory/View.pm
@@ -189,17 +189,16 @@ template 'change_field' => sub {
class is 'field-name';
outs $field;
};
- outs " changed from '";
+ outs " changed from ";
span {
class is 'old-value';
outs $old;
};
- outs "' to '";
+ outs " to ";
span {
class is 'new-value';
outs $new;
};
- outs "'";
};
};
commit 662d084da63c61d63d67960d214f1b2d4850e12f
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Feb 14 15:51:11 2011 -0500
Tell MI to install_share
diff --git a/Makefile.PL b/Makefile.PL
index b289f6f..abc1cc0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -9,6 +9,7 @@ build_requires 'Test::More';
tests('t/*/t/*.t');
+install_share;
auto_install;
WriteAll;
diff --git a/inc/Module/Install/Share.pm b/inc/Module/Install/Share.pm
new file mode 100644
index 0000000..f1e3bdd
--- /dev/null
+++ b/inc/Module/Install/Share.pm
@@ -0,0 +1,96 @@
+#line 1
+package Module::Install::Share;
+
+use strict;
+use Module::Install::Base ();
+use File::Find ();
+use ExtUtils::Manifest ();
+
+use vars qw{$VERSION @ISA $ISCORE};
+BEGIN {
+ $VERSION = '1.00';
+ @ISA = 'Module::Install::Base';
+ $ISCORE = 1;
+}
+
+sub install_share {
+ my $self = shift;
+ my $dir = @_ ? pop : 'share';
+ my $type = @_ ? shift : 'dist';
+ unless ( defined $type and $type eq 'module' or $type eq 'dist' ) {
+ die "Illegal or invalid share dir type '$type'";
+ }
+ unless ( defined $dir and -d $dir ) {
+ require Carp;
+ Carp::croak("Illegal or missing directory install_share param");
+ }
+
+ # Split by type
+ my $S = ($^O eq 'MSWin32') ? "\\" : "\/";
+
+ my $root;
+ if ( $type eq 'dist' ) {
+ die "Too many parameters to install_share" if @_;
+
+ # Set up the install
+ $root = "\$(INST_LIB)${S}auto${S}share${S}dist${S}\$(DISTNAME)";
+ } else {
+ my $module = Module::Install::_CLASS($_[0]);
+ unless ( defined $module ) {
+ die "Missing or invalid module name '$_[0]'";
+ }
+ $module =~ s/::/-/g;
+
+ $root = "\$(INST_LIB)${S}auto${S}share${S}module${S}$module";
+ }
+
+ my $manifest = -r 'MANIFEST' ? ExtUtils::Manifest::maniread() : undef;
+ my $skip_checker = $ExtUtils::Manifest::VERSION >= 1.54
+ ? ExtUtils::Manifest::maniskip()
+ : ExtUtils::Manifest::_maniskip();
+ my $postamble = '';
+ my $perm_dir = eval($ExtUtils::MakeMaker::VERSION) >= 6.52 ? '$(PERM_DIR)' : 755;
+ File::Find::find({
+ no_chdir => 1,
+ wanted => sub {
+ my $path = File::Spec->abs2rel($_, $dir);
+ if (-d $_) {
+ return if $skip_checker->($File::Find::name);
+ $postamble .=<<"END";
+\t\$(NOECHO) \$(MKPATH) "$root${S}$path"
+\t\$(NOECHO) \$(CHMOD) $perm_dir "$root${S}$path"
+END
+ }
+ else {
+ return if ref $manifest
+ && !exists $manifest->{$File::Find::name};
+ return if $skip_checker->($File::Find::name);
+ $postamble .=<<"END";
+\t\$(NOECHO) \$(CP) "$dir${S}$path" "$root${S}$path"
+END
+ }
+ },
+ }, $dir);
+
+ # Set up the install
+ $self->postamble(<<"END_MAKEFILE");
+config ::
+$postamble
+
+END_MAKEFILE
+
+ # The above appears to behave incorrectly when used with old versions
+ # of ExtUtils::Install (known-bad on RHEL 3, with 5.8.0)
+ # So when we need to install a share directory, make sure we add a
+ # dependency on a moderately new version of ExtUtils::MakeMaker.
+ $self->build_requires( 'ExtUtils::MakeMaker' => '6.11' );
+
+ # 99% of the time we don't want to index a shared dir
+ $self->no_index( directory => $dir );
+}
+
+1;
+
+__END__
+
+#line 154
commit cfc49c35e6402a565255cc681b7d47393a303a87
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Feb 14 15:51:48 2011 -0500
record-history.css
diff --git a/lib/Jifty/Plugin/RecordHistory.pm b/lib/Jifty/Plugin/RecordHistory.pm
index 6433840..5938e85 100644
--- a/lib/Jifty/Plugin/RecordHistory.pm
+++ b/lib/Jifty/Plugin/RecordHistory.pm
@@ -5,6 +5,10 @@ use base qw/Jifty::Plugin/;
our $VERSION = '0.01';
+sub init {
+ Jifty->web->add_css('record-history.css');
+}
+
1;
__END__
diff --git a/share/web/static/css/record-history.css b/share/web/static/css/record-history.css
new file mode 100644
index 0000000..db787bd
--- /dev/null
+++ b/share/web/static/css/record-history.css
@@ -0,0 +1,7 @@
+.change-field .field-name {
+ font-weight: bold;
+}
+
+.change-field .old-value, .change-field .new-value {
+ font-weight: bold;
+}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list