[Jifty-commit] r3720 - in jifty/branches/trimclient: .
lib/Jifty/Plugin lib/Jifty/Plugin/ActorMetadata/Mixin/Model
lib/Jifty/Plugin/GoogleMap share/web/static/js t/TestApp/t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Jul 25 06:02:29 EDT 2007
Author: clkao
Date: Wed Jul 25 06:02:24 2007
New Revision: 3720
Modified:
jifty/branches/trimclient/ (props changed)
jifty/branches/trimclient/Makefile.PL
jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata.pm
jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm
jifty/branches/trimclient/lib/Jifty/Plugin/GoogleMap/Widget.pm
jifty/branches/trimclient/lib/Jifty/View/Declare/CRUD.pm
jifty/branches/trimclient/share/web/static/js/jifty.js
jifty/branches/trimclient/t/TestApp/t/02-dispatch-show-rule-in-wrong-ruleset.t
Log:
Merge down for trimclient.
Modified: jifty/branches/trimclient/Makefile.PL
==============================================================================
--- jifty/branches/trimclient/Makefile.PL (original)
+++ jifty/branches/trimclient/Makefile.PL Wed Jul 25 06:02:24 2007
@@ -26,6 +26,7 @@
requires('Email::MIME::Creator');
requires('Email::MIME::ContentType');
requires('Email::MIME::CreateHTML');
+requires('Email::MIME::Modifier');
requires('Email::Send' => '1.99_01'); # Email::Send::Jifty::Test
requires('Email::Simple');
requires('Email::Simple::Creator');
Modified: jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata.pm
==============================================================================
--- jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata.pm (original)
+++ jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata.pm Wed Jul 25 06:02:24 2007
@@ -4,4 +4,30 @@
package Jifty::Plugin::ActorMetadata;
use base qw/Jifty::Plugin/;
+=head1 NAME
+
+Jifty::Plugin::ActorMetadata
+
+=head1 DESCRIPTION
+
+This plugin adds a model mixin which adds C<created_by>, C<created_on> and C<updated_on> columns to a model class.
+
+=head1 EXAMPLE
+
+use strict;
+ use warnings;
+
+ package MeetMeow::Model::Cat;
+ use Jifty::DBI::Schema;
+
+ use MeetMeow::Record schema {
+
+ ...
+
+ };
+ use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on
+
+
+=cut
+
1;
Modified: jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm
==============================================================================
--- jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm (original)
+++ jifty/branches/trimclient/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm Wed Jul 25 06:02:24 2007
@@ -84,6 +84,12 @@
$self->add_trigger(name => 'before_create', callback => \&before_create);
}
+=head2 before_create
+
+Sets C<created_by>, C<created_on>, C<updated_on> based on the current user and time.
+
+=cut
+
sub before_create {
my $self = shift;
my $args = shift;
@@ -94,7 +100,15 @@
return 1;
}
+=head2 current_user_can
+
+Rejects creation unless there's a current_user.
+Rejects update or deletion unless the current_user is the creator. (Jesse says: this feels like wrong logic for this mixin)
+
+=cut
+
# XXX: Move this to an abortable trigger
+
sub current_user_can {
my $self = shift;
my $action = shift;
Modified: jifty/branches/trimclient/lib/Jifty/Plugin/GoogleMap/Widget.pm
==============================================================================
--- jifty/branches/trimclient/lib/Jifty/Plugin/GoogleMap/Widget.pm (original)
+++ jifty/branches/trimclient/lib/Jifty/Plugin/GoogleMap/Widget.pm Wed Jul 25 06:02:24 2007
@@ -14,6 +14,13 @@
=cut
+=head2 accessors
+
+Returns this class's Clas::Accessor based accessors
+
+=cut
+
+
sub accessors { shift->SUPER::accessors() };
=head2 render_widget
Modified: jifty/branches/trimclient/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/branches/trimclient/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/branches/trimclient/lib/Jifty/View/Declare/CRUD.pm Wed Jul 25 06:02:24 2007
@@ -335,6 +335,13 @@
};
+=head2 per_page
+
+This routine returns how many items should be shown on each page of a listing.
+The default is 25.
+
+=cut
+
sub per_page { 25 }
sub _current_collection {
Modified: jifty/branches/trimclient/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/trimclient/share/web/static/js/jifty.js (original)
+++ jifty/branches/trimclient/share/web/static/js/jifty.js Wed Jul 25 06:02:24 2007
@@ -1157,7 +1157,8 @@
response_fragment = response_fragment.nextSibling) {
var exp_id = response_fragment.getAttribute("id");
- if (!expected_fragments.find(function(f) { return exp_id == f['region'] }))
+ var f = expected_fragments.find(function(f) { return exp_id == f['region'] });
+ if (!f)
continue;
try {
Modified: jifty/branches/trimclient/t/TestApp/t/02-dispatch-show-rule-in-wrong-ruleset.t
==============================================================================
--- jifty/branches/trimclient/t/TestApp/t/02-dispatch-show-rule-in-wrong-ruleset.t (original)
+++ jifty/branches/trimclient/t/TestApp/t/02-dispatch-show-rule-in-wrong-ruleset.t Wed Jul 25 06:02:24 2007
@@ -4,7 +4,7 @@
use lib 't/lib';
use Jifty::SubTest;
-use Jifty::Test tests => 9;
+use Jifty::Test tests => 8;
use Jifty::Test::WWW::Mechanize;
use Test::Log4perl;
@@ -16,7 +16,7 @@
my $mech = Jifty::Test::WWW::Mechanize->new();
{
- my $log = Test::Log4perl->expect(['', warn => qr/You can't call a 'show' rule in a 'before' or 'after' block in the dispatcher/ ]);
+# my $log = Test::Log4perl->expect(['', warn => qr/You can't call a 'show' rule in a 'before' or 'after' block in the dispatcher/ ]);
$mech->get("$URL/before_stage_show", "Got /before_stage_show");
$mech->content_lacks("This is content");
is( $mech->status , '404');
More information about the Jifty-commit
mailing list