diff src/ur/openidUser.ur @ 20:2342d9baa0df

New OpenidUser.Make parameter: ready
author Adam Chlipala <adam@chlipala.net>
date Thu, 06 Jan 2011 16:46:09 -0500
parents dd8eb53da51b
children 354dae3008de
line wrap: on
line diff
--- a/src/ur/openidUser.ur	Thu Jan 06 15:25:11 2011 -0500
+++ b/src/ur/openidUser.ur	Thu Jan 06 16:46:09 2011 -0500
@@ -8,6 +8,7 @@
                  type creationData
                  val creationState : transaction creationState
                  val render : creationState -> xtable
+                 val ready : creationState -> signal bool
                  val tabulate : creationState -> signal creationData
                  val choose : sql_table ([Id = string] ++ cols) [Pkey = [Id]] -> creationData -> transaction $cols
 
@@ -117,12 +118,17 @@
                       <table class={M.formClass}>
                         <tr> <th class={M.formClass}>Username:</th> <td><ctextbox source={uid}/></td> </tr>
                         {M.render cs}
-                        <tr> <td><button value="Create Account" onclick={uid <- get uid;
-                                                                         data <- Basis.current (M.tabulate cs);
-                                                                         res <- rpc (finishSignup uid data);
-                                                                         case res of
-                                                                             None => redirect (bless after)
-                                                                           | Some msg => alert msg}/></td> </tr>
+                        <tr> <td><dyn signal={b <- M.ready cs;
+                                              return (if b then
+                                                          <xml><button value="Create Account"
+                                                                       onclick={uid <- get uid;
+                                                                                data <- Basis.current (M.tabulate cs);
+                                                                                res <- rpc (finishSignup uid data);
+                                                                                case res of
+                                                                                    None => redirect (bless after)
+                                                                                  | Some msg => alert msg}/></xml>
+                                                      else
+                                                          <xml/>)}/></td> </tr>
                       </table>
                     </xml>
                 end