Making login page fancier or Injecting one widget inside another

63 views Asked by At
  loginHandler = do
  tp <- getRouteToParent
  lift $ defaultLayout $ do
    --setTitleI Msg.LoginTitle
    master <- getYesod
    --mapM_ ( flip apLogin tp ) ( authPlugins master )
    [whamlet|<h3>Authentication providers|]
    let ws = mapM ( flip apLogin tp ) ( authPlugins master )
    [whamlet|
      <ul>
        $forall w <- ws
          <li>^{w}
    |]

In the code above (it doesn't compile) I'm trying to list all available authentication providers in a html list (ul, li, etc)...

Normally widgets are combined easily side-by-side: w1 >> w2 >> w3 ... Is there any way to inject (!) one widget inside another?

1

There are 1 answers

0
Michael Snoyman On

It's usually best to include error messages with a question like this. I believe the answer is to replace mapM with map, but it's hard to tell given that I don't know why the current code doesn't work.