added user slug (just for dodo)
This commit is contained in:
parent
c60e8cdcd9
commit
edf583dcfb
3 changed files with 10 additions and 3 deletions
|
@ -74,6 +74,13 @@ instance Yesod App where
|
|||
return $ userName user
|
||||
Nothing -> do
|
||||
return ("" :: Text)
|
||||
slug <- case msu of
|
||||
Just a -> do
|
||||
uId <- return $ getUserIdFromText a
|
||||
user <- runDB $ getJust uId
|
||||
return $ userSlug user
|
||||
Nothing -> do
|
||||
return ("" :: Text)
|
||||
|
||||
|
||||
-- We break up the default layout into two components:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
User
|
||||
name Text
|
||||
slug Text
|
||||
email Text
|
||||
password Text
|
||||
salt ByteString
|
||||
salted ByteString Maybe
|
||||
salted ByteString
|
||||
albums [AlbumId]
|
||||
deriving Typeable
|
||||
Activator
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div id="top-nav">
|
||||
<ul id="user-nav">
|
||||
$maybe userId <- msu
|
||||
Logged in as <a href=@{UserR username}>#{username}
|
||||
Logged in as <a href=@{UserR username}>#{slug}
|
||||
<li>
|
||||
<a href=@{LogoutR}>Logout
|
||||
<li>
|
||||
|
|
Loading…
Reference in a new issue