diff --git a/Yesod/Helpers/Auth.hs b/Yesod/Helpers/Auth.hs index 43043fe6..111be0f4 100644 --- a/Yesod/Helpers/Auth.hs +++ b/Yesod/Helpers/Auth.hs @@ -94,9 +94,7 @@ setCreds doRedirects creds = do then do case authRoute y of Nothing -> do - rh <- defaultLayout $ addBody [$hamlet| -%h1 Invalid login -|] + rh <- defaultLayout [$hamlet|%h1 Invalid login|] sendResponse rh Just ar -> do setMessage $ string "Invalid login" @@ -115,7 +113,7 @@ getCheckR = do creds <- maybeAuthId defaultLayoutJson (do setTitle $ string "Authentication Status" - addBody $ html creds) (json creds) + addHtml $ html creds) (json creds) where html creds = [$hamlet| %h1 Authentication Status diff --git a/Yesod/Helpers/Auth/Dummy.hs b/Yesod/Helpers/Auth/Dummy.hs index 1cbde6be..03bc7fd9 100644 --- a/Yesod/Helpers/Auth/Dummy.hs +++ b/Yesod/Helpers/Auth/Dummy.hs @@ -18,8 +18,7 @@ authDummy = setCreds True $ Creds "dummy" ident [] dispatch _ _ = notFound url = PluginR "dummy" [] - login authToMaster = do - addBody [$hamlet| + login authToMaster = [$hamlet| %form!method=post!action=@authToMaster.url@ Your new identifier is: $ %input!type=text!name=ident diff --git a/Yesod/Helpers/Auth/Email.hs b/Yesod/Helpers/Auth/Email.hs index 0b1fadac..581d8c9c 100644 --- a/Yesod/Helpers/Auth/Email.hs +++ b/Yesod/Helpers/Auth/Email.hs @@ -76,8 +76,7 @@ authEmail = dispatch "POST" ["set-password"] = go postPasswordR dispatch _ _ = notFound - login' tm = do - addBody [$hamlet| + login' tm = [$hamlet| %form!method=post!action=@tm.login@ %table %tr @@ -99,7 +98,7 @@ getRegisterR = do toMaster <- getRouteToMaster defaultLayout $ do setTitle $ string "Register a new account" - addBody [$hamlet| + addHamlet [$hamlet| %p Enter your e-mail address below, and a confirmation e-mail will be sent to you. %form!method=post!action=@toMaster.register@ %label!for=email E-mail @@ -129,7 +128,7 @@ postRegisterR = do sendVerifyEmail email verKey verUrl defaultLayout $ do setTitle $ string "Confirmation e-mail sent" - addBody [$hamlet| + addWidget [$hamlet| %p A confirmation e-mail has been sent to $email$. |] @@ -151,7 +150,7 @@ getVerifyR lid key = do _ -> return () defaultLayout $ do setTitle $ string "Invalid verification key" - addBody [$hamlet| + addHtml [$hamlet| %p I'm sorry, but that was an invalid verification key. |] @@ -191,7 +190,7 @@ getPasswordR = do redirect RedirectTemporary $ toMaster login defaultLayout $ do setTitle $ string "Set password" - addBody [$hamlet| + addHamlet [$hamlet| %h3 Set a new password %form!method=post!action=@toMaster.setpass@ %table diff --git a/Yesod/Helpers/Auth/Facebook.hs b/Yesod/Helpers/Auth/Facebook.hs index 0c9d237e..0a4b9388 100644 --- a/Yesod/Helpers/Auth/Facebook.hs +++ b/Yesod/Helpers/Auth/Facebook.hs @@ -53,7 +53,7 @@ authFacebook cid secret perms = render <- liftHandler getUrlRender let fb = Facebook.Facebook cid secret $ render $ tm url let furl = Facebook.getForwardUrl fb $ perms - addBody [$hamlet| + addHtml [$hamlet| %p %a!href=$furl$ Login with Facebook |] diff --git a/Yesod/Helpers/Auth/OpenId.hs b/Yesod/Helpers/Auth/OpenId.hs index 341d6c1d..62d0b7bf 100644 --- a/Yesod/Helpers/Auth/OpenId.hs +++ b/Yesod/Helpers/Auth/OpenId.hs @@ -20,12 +20,12 @@ authOpenId = name = "openid_identifier" login tm = do ident <- newIdent - addStyle [$cassius| + addCassius [$cassius| #$ident$ background: #fff url(http://www.myopenid.com/static/openid-icon-small.gif) no-repeat scroll 0pt 50%; padding-left: 18px; |] - addBody [$hamlet| + addHamlet [$hamlet| %form!method=get!action=@tm.forwardUrl@ %label!for=openid OpenID: $ %input#$ident$!type=text!name=$name$!value="http://" diff --git a/Yesod/Helpers/Auth/Rpxnow.hs b/Yesod/Helpers/Auth/Rpxnow.hs index 321f1caa..a831ecf7 100644 --- a/Yesod/Helpers/Auth/Rpxnow.hs +++ b/Yesod/Helpers/Auth/Rpxnow.hs @@ -17,7 +17,7 @@ authRpxnow app apiKey = where login tm = do let url = {- FIXME urlEncode $ -} tm $ PluginR "rpxnow" [] - addBody [$hamlet| + addHamlet [$hamlet| %iframe!src="http://$app$.rpxnow.com/openid/embed?token_url=@url@"!scrolling=no!frameBorder=no!allowtransparency=true!style="width:400px;height:240px" |] dispatch _ [] = do