[Rt-commit] r15951 - in rt/branches/3.999-DANGEROUS: lib/RT

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Sep 12 12:24:25 EDT 2008


Author: sunnavy
Date: Fri Sep 12 12:24:25 2008
New Revision: 15951

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/lib/RT/View.pm

Log:
 r16679 at sunnavys-mb:  sunnavy | 2008-09-12 22:56:42 +0800
 customize login page


Modified: rt/branches/3.999-DANGEROUS/lib/RT/View.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/View.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/View.pm	Fri Sep 12 12:24:25 2008
@@ -60,4 +60,28 @@
 
 __PACKAGE__->use_mason_wrapper;
 
+template login_widget => sub {
+
+    outs_raw('</div>'); # End of div#quickbar from /Elements/Header
+    my ( $action, $next ) = get( 'action', 'next' );
+    $action ||= new_action( class => 'Login' );
+    $next ||= Jifty::Continuation->new(
+        request => Jifty::Request->new( path => "/" ) );
+    unless ( Jifty->web->current_user->id ) {
+        div {
+            attr { id => 'body', class => 'login-body' };
+            div {
+                attr { id => 'login-box' };
+                Jifty->web->form->start( call => $next );
+                render_param( $action, 'email', focus => 1 );
+                render_param( $action, $_ ) for (qw(password remember));
+                form_return( label => _(q{Login}), submit => $action );
+                Jifty->web->form->end();
+            };
+        };
+    } else {
+        outs( _("You're already logged in.") );
+    }
+};
+
 1;


More information about the Rt-commit mailing list