[Jifty-commit] r3027 - in jifty/trunk:
lib/Jifty/Plugin/Authentication/Password
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sun Mar 18 22:03:34 EDT 2007
Author: jesse
Date: Sun Mar 18 22:03:33 2007
New Revision: 3027
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/Authentication/Password/View.pm
Log:
r53622 at pinglin: jesse | 2007-03-18 21:37:50 -0400
* return from tangents for login, signup, password reminders
Modified: jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm Sun Mar 18 22:03:33 2007
@@ -51,7 +51,7 @@
=cut
-on qr/^(?:passwordreminder|signup)$/ => run {
+before qr'^/(?:passwordreminder|signup|lost_password)$' => run {
redirect('/') if ( Jifty->web->current_user->id );
set 'next' => Jifty->web->request->continuation || Jifty::Continuation->new( request => Jifty::Request->new( path => "/login" ) );
};
@@ -60,7 +60,7 @@
=cut
-on qr/^(?:login)$/ => run {
+before qr|^/(?:login)$| => run {
redirect('/') if ( Jifty->web->current_user->id );
set 'next' => Jifty->web->request->continuation || Jifty::Continuation->new( request => Jifty::Request->new( path => "/" ) );
};
@@ -71,7 +71,7 @@
=cut
-on 'passwordreminder' => run {
+before 'passwordreminder' => run {
set 'action' => Jifty->web->new_action( class => 'SendPasswordReminder', moniker => 'password_reminder');
};
@@ -82,7 +82,7 @@
=cut
-on 'signup' => run {
+before 'signup' => run {
set 'action' => Jifty->web->new_action( class => 'Signup');
};
@@ -93,7 +93,7 @@
=cut
-on 'login' => run {
+before 'login' => run {
set 'action' => Jifty->web->new_action( class => 'Login');
};
Modified: jifty/trunk/lib/Jifty/Plugin/Authentication/Password/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Authentication/Password/View.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Authentication/Password/View.pm Sun Mar 18 22:03:33 2007
@@ -71,14 +71,15 @@
};
template 'let/reset_lost_password' => page {
+ my ( $next ) = get(qw(next));
attr { title => 'Reset lost password' };
my $action = Jifty->web->new_action( class => 'ResetLostPassword' );
h2 { _('Reset lost password') };
- form {
+ Jifty->web->form->start( call => $next );
render_param( $action => $_ ) for ( $action->argument_names );
- form_submit( label => _("New password") );
- };
+ form_return( label => _("New password"), submit => $action );
+ Jifty->web->form->end();
};
template 'let/confirm_email' => sub {
@@ -87,6 +88,7 @@
};
template 'lost_password' => page {
+ my ( $next ) = get(qw(next));
my $action = Jifty->web->new_action(
moniker => 'password_reminder',
class => 'SendPasswordReminder',
@@ -94,15 +96,17 @@
h2 { _('Send a link to reset your password') };
outs( _( "You lost your password. A link to reset it will be sent to the following email address:"));
-
- form {
- render_param( $action => $_ ) for ( $action->argument_names );
- form_submit( label => _("Send") );
- }
+ outs($next);
+ my $focused = 0;
+ Jifty->web->form->start( call => $next );
+ render_param( $action => $_, focus => $focused++ ? 0 : 1 ) for ( $action->argument_names );
+ form_return( label => _(q{Send}), submit => $action);
+ Jifty->web->form->end;
};
template 'passwordreminder' => page {
+ my $next = get('next');
attr { title => 'Send Password Reminder' };
my $action = Jifty->web->new_action(
moniker => 'password_reminder',
@@ -111,10 +115,10 @@
h2 { _('Send a password reminder') };
p { _( "You lost your password. A reminder will be send to the following mail:") };
- form {
+ Jifty->web->form->start( call => $next );
render_param( $action => $_ ) for ( $action->argument_names );
- form_submit( label => _("Send") );
- };
+ form_return( label => _("Send"), submit => $action);
+ Jifty->web->form->end();
};
1;
More information about the Jifty-commit
mailing list