[Jifty-commit] r3311 - jifty/trunk/lib/Jifty/Plugin/OpenID

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jun 1 09:29:04 EDT 2007


Author: gugod
Date: Fri Jun  1 09:29:03 2007
New Revision: 3311

Added:
   jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm

Log:
The minimum required OpenID View for your app to mixin.


Added: jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm
==============================================================================
--- (empty file)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/View.pm	Fri Jun  1 09:29:03 2007
@@ -0,0 +1,60 @@
+package Jifty::Plugin::OpenID::View;
+use strict;
+use warnings;
+use Jifty::View::Declare -base;
+
+template 'login' => page {
+    { title is _ "Login with your OpenID" }
+    my $action = get('action');
+
+    div {
+        unless ( Jifty->web->current_user->id ) {
+            div {
+                attr { id => 'openid-login' };
+                outs(
+                    p {
+                        em {
+                            _(  qq{If you have a Livejournal or other OpenID account, you don\'t even need to sign up. Just log in.}
+                            );
+                        }
+                    }
+                );
+                form {
+                    render_action($action);
+                    form_submit(
+                        label  => _("Go for it!"),
+                        submit => $action
+                    );
+                }
+            };
+        }
+        else {
+            outs( _("You already logged in.") );
+        }
+    }
+};
+
+template 'create' => page {
+    title is 'Set your username';
+    my ( $action, $next ) = get( 'action', 'next' );
+
+    p {
+        outs(
+            _(  'We need you to set a username or quickly check the one associated with your OpenID. Your username is what other people will see when you ask questions or make suggestions'
+            )
+        );
+    };
+    p {
+        outs(
+            _(  'If the username provided conflicts with an existing username or contains invalid characters, you will have to give us a new one.'
+            )
+        );
+    };
+    Jifty->web->form->start( call => $next );
+    render_param( $action, 'name', default_value => get('nickname') );
+    form_submit( label => _('Continue'), submit => $action );
+    Jifty->web->form->end;
+};
+
+
+1;


More information about the Jifty-commit mailing list