Implemented logout and generally fixed the in/out sequence. #69
[zzz-spline-users.git] / spline / plugins / users / templates / widgets / user_state.mako
index d279dc4..dbc73a0 100644 (file)
@@ -1,9 +1,12 @@
-${h.form(url(controller='accounts', action='login_begin'), id='user')}
-    % if c.user:
+% if c.user:
+${h.form(url(controller='accounts', action='logout'), id='user')}
     Logged in as ${c.user.name}.
-    % else:
+    <input type="submit" value="Log out">
+${h.end_form()}
+% else:
+${h.form(url(controller='accounts', action='login_begin'), id='user')}
     <img src="${h.static_uri('spline', 'icons/openid.png')}">
     <input type="text" name="openid" size="30">
     <input type="submit" value="Log in">
-    % endif
 ${h.end_form()}
+% endif