[Jifty-commit] r1636 - wifty/trunk/lib/Wifty/Action

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jul 21 02:53:19 EDT 2006


Author: audreyt
Date: Fri Jul 21 02:53:18 2006
New Revision: 1636

Modified:
   wifty/trunk/lib/Wifty/Action/Login.pm
   wifty/trunk/lib/Wifty/Action/Logout.pm
   wifty/trunk/lib/Wifty/Action/ResetLostPassword.pm
   wifty/trunk/lib/Wifty/Action/SendAccountConfrimation.pm

Log:
* Wifty: Updated actions to use declarative parameters.

Modified: wifty/trunk/lib/Wifty/Action/Login.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Action/Login.pm	(original)
+++ wifty/trunk/lib/Wifty/Action/Login.pm	Fri Jul 21 02:53:18 2006
@@ -8,32 +8,27 @@
 =cut
 
 package Wifty::Action::Login;
-use base qw/Wifty::Action Jifty::Action/;
+use base qw/Wifty::Action/;
+use Jifty::Param::Schema;
+use Jifty::Action schema {
+
+param email =>
+    label is 'Email address',
+    is mandatory,
+    ajax validates;
+
+param password =>
+    type is 'password',
+    label is 'Password',
+    is mandatory;
+
+param remember =>
+    type is 'checkbox',
+    label is 'Remember me?',
+    hints is 'If you want, your browser can remember your login for you',
+    default is 0;
 
-=head2 arguments
-
-Return the email and password form fields
-
-=cut
-
-sub arguments { 
-    return( { email => { label => 'Email address',
-                           mandatory => 1,
-                           ajax_validates => 1,
-                            }  ,
-
-              password => { type => 'password',
-                            label => 'Password',
-                            mandatory => 1
-                        },
-              remember => { type => 'checkbox',
-                            label => 'Remember me?',
-                            hints => 'If you want, your browser can remember your login for you',
-                            default => 0,
-                          }
-          });
-
-}
+};
 
 =head2 validate_email ADDRESS
 

Modified: wifty/trunk/lib/Wifty/Action/Logout.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Action/Logout.pm	(original)
+++ wifty/trunk/lib/Wifty/Action/Logout.pm	Fri Jul 21 02:53:18 2006
@@ -10,16 +10,6 @@
 package Wifty::Action::Logout;
 use base qw/Wifty::Action Jifty::Action/;
 
-=head2 arguments
-
-Return the email and password form fields
-
-=cut
-
-sub arguments { 
-    return( { });
-}
-
 =head2 take_action
 
 Nuke the current user object

Modified: wifty/trunk/lib/Wifty/Action/ResetLostPassword.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Action/ResetLostPassword.pm	(original)
+++ wifty/trunk/lib/Wifty/Action/ResetLostPassword.pm	Fri Jul 21 02:53:18 2006
@@ -14,23 +14,22 @@
 =cut
 
 package Wifty::Action::ResetPassword;
-use base qw/Wifty::Action Jifty::Action/;
-
 use Wifty::Model::User;
+use base qw/Wifty::Action/;
 
-=head2 arguments
+use Jifty::Param::Schema;
+use Jifty::Action schema {
 
-ConfirmEmail has the following fields: address, code, password, and password_confirm.
-Note that it can get the first two from the confirm dhandler.
+param password =>
+    type is 'password',
+    ! is sticky;
 
-=cut
+param password_confirm =>
+    type is 'password',
+    label is 'type your password again',
+    ! is sticky;
 
-sub arguments { 
-    return( { 
-              password => { type => 'password', sticky => 0 },
-              password_confirm => { type => 'password', sticky => 0, label => 'type your password again' },
-          }); 
-}
+};
 
 =head2 take_action
 

Modified: wifty/trunk/lib/Wifty/Action/SendAccountConfrimation.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Action/SendAccountConfrimation.pm	(original)
+++ wifty/trunk/lib/Wifty/Action/SendAccountConfrimation.pm	Fri Jul 21 02:53:18 2006
@@ -8,27 +8,21 @@
 =cut
 
 package Wifty::Action::ResendConfirmation;
-use base qw/Wifty::Action Jifty::Action/;
-
-__PACKAGE__->mk_accessors(qw(user_object));
 
 use Wifty::Model::User;
+use base qw/Wifty::Action/;
 
-=head2 arguments
-
-The field for C<ResendConfirmation> is:
-
-=over 4
-
-=item address: the email address
+__PACKAGE__->mk_accessors(qw(user_object));
 
-=back
+use Jifty::Param::Schema;
+use Jifty::Action schema {
 
-=cut
+param address =>
+    label is 'email address',
+    is mandatory,
+    default is '';
 
-sub arguments {
-    return ( { address => { label     => 'email address', mandatory => 1, default_value => "", }, });
-}
+};
 
 =head2 setup
 


More information about the Jifty-commit mailing list