changeset 31:1be573ac8e2b

Add some formatting options to the user control xml.
author Karn Kallio <kkallio@eka>
date Mon, 18 Apr 2011 01:20:39 -0430
parents 5d6337df5ec7
children 90b8ce9be9f5
files src/ur/openidUser.ur src/ur/openidUser.urs
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ur/openidUser.ur	Sun Apr 17 13:15:10 2011 -0400
+++ b/src/ur/openidUser.ur	Mon Apr 18 01:20:39 2011 -0430
@@ -28,6 +28,9 @@
                  val realm : option string
                  val formClass : css_class
                  val fakeId : option string
+
+                 val ctlDisplay : {User : {Status : xbody, Other : xbody},
+                                   Guest : {Status : xbody, Other : xbody}}
              end) = struct
 
     type user = string
@@ -296,10 +299,10 @@
             cur <- current;
             here <- currentUrl;
             case cur of
-                Some cur => return {Status = <xml>Logged in as {[cur]}.</xml>,
-                                    Other = <xml><a link={logout ()}>Log out</a></xml>}
-              | None => return {Status = <xml><form><textbox{#User}/> <submit value="Log In" action={logon (show here)}/></form></xml>,
-                                Other = <xml><a link={signup (show here)}>Sign up</a></xml>}
+                Some cur => return {Status = <xml>{M.ctlDisplay.User.Status}{[cur]}</xml>,
+                                    Other = <xml><a link={logout ()}>{M.ctlDisplay.User.Other}</a></xml>}
+              | None => return {Status = <xml>{M.ctlDisplay.Guest.Status}<form><textbox{#User}/> <submit value="Log In" action={logon (show here)}/></form></xml>,
+                                Other = <xml><a link={signup (show here)}>{M.ctlDisplay.Guest.Other}</a></xml>}
         end
 
     task periodic 60 = fn () => dml (DELETE FROM session
--- a/src/ur/openidUser.urs	Sun Apr 17 13:15:10 2011 -0400
+++ b/src/ur/openidUser.urs	Mon Apr 18 01:20:39 2011 -0430
@@ -66,6 +66,10 @@
                  (* If set, this string is always accepted as a verified
                   * identifier, which can be useful during development (say,
                   * when you're off-network). *)
+                  
+                 val ctlDisplay : {User : {Status : xbody, Other : xbody},
+                                   Guest : {Status : xbody, Other : xbody}}
+                 (* These help formatting the user status controls *)
              end) : sig
 
     type user