[Jifty-commit] r3708 - in jifty/trunk: . lib/Jifty/Plugin
lib/Jifty/Plugin/GoogleMap lib/Jifty/View/Declare
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Jul 22 16:22:03 EDT 2007
Author: jesse
Date: Sun Jul 22 16:22:02 2007
New Revision: 3708
Modified:
jifty/trunk/ (props changed)
jifty/trunk/Makefile.PL
jifty/trunk/lib/Jifty/Plugin/ActorMetadata.pm
jifty/trunk/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm
jifty/trunk/lib/Jifty/Plugin/GoogleMap/Widget.pm
jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
Log:
r61115 at 106: jesse | 2007-07-22 12:48:51 -0700
* added some pod to help make pod tests pass
Modified: jifty/trunk/Makefile.PL
==============================================================================
--- jifty/trunk/Makefile.PL (original)
+++ jifty/trunk/Makefile.PL Sun Jul 22 16:22:02 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/trunk/lib/Jifty/Plugin/ActorMetadata.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/ActorMetadata.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/ActorMetadata.pm Sun Jul 22 16:22:02 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/trunk/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/ActorMetadata/Mixin/Model/ActorMetadata.pm Sun Jul 22 16:22:02 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/trunk/lib/Jifty/Plugin/GoogleMap/Widget.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/GoogleMap/Widget.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/GoogleMap/Widget.pm Sun Jul 22 16:22:02 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/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm Sun Jul 22 16:22:02 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 {
More information about the Jifty-commit
mailing list