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
|
return $ userName user
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
return ("" :: Text)
|
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:
|
-- We break up the default layout into two components:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
User
|
User
|
||||||
name Text
|
name Text
|
||||||
|
slug Text
|
||||||
email Text
|
email Text
|
||||||
password Text
|
|
||||||
salt ByteString
|
salt ByteString
|
||||||
salted ByteString Maybe
|
salted ByteString
|
||||||
albums [AlbumId]
|
albums [AlbumId]
|
||||||
deriving Typeable
|
deriving Typeable
|
||||||
Activator
|
Activator
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div id="top-nav">
|
<div id="top-nav">
|
||||||
<ul id="user-nav">
|
<ul id="user-nav">
|
||||||
$maybe userId <- msu
|
$maybe userId <- msu
|
||||||
Logged in as <a href=@{UserR username}>#{username}
|
Logged in as <a href=@{UserR username}>#{slug}
|
||||||
<li>
|
<li>
|
||||||
<a href=@{LogoutR}>Logout
|
<a href=@{LogoutR}>Logout
|
||||||
<li>
|
<li>
|
||||||
|
|
Loading…
Reference in a new issue