Browse Source

added a login/logout navbar

elm
parent
commit
a503ef49cf
  1. 1
      Foundation.hs
  2. 21
      templates/default-layout.hamlet

1
Foundation.hs

@ -65,6 +65,7 @@ instance Yesod App where
defaultLayout widget = do
master <- getYesod
mmsg <- getMessage
muser <- maybeAuthId
-- We break up the default layout into two components:
-- default-layout is the contents of the body tag, and

21
templates/default-layout.hamlet

@ -1,3 +1,22 @@
$maybe msg <- mmsg
<div #message>#{msg}
<div .alert>
<button type="button" .close data-dismiss="alert">&times;
<strong>
Warning
#{msg}
<div .navbar>
<div .navbar-inner>
<a href=@{HomeR} .brand>
Soggoth Example
<ul .nav>
<li .active>
<a href=@{HomeR}>Home
<li>
<a href=@{CatsR}>Cats
<li>
$maybe _ <- muser
<a href=@{AuthR LogoutR} .logout>Logout
$nothing
<a href=@{AuthR LoginR} .login>Login
^{widget}

Loading…
Cancel
Save