added user slug (just for dodo)

This commit is contained in:
nek0 2014-08-26 04:36:21 +02:00
parent c60e8cdcd9
commit edf583dcfb
3 changed files with 10 additions and 3 deletions

View file

@ -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:

View file

@ -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

View file

@ -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>