From edf583dcfb6c7ad45f740fa53d1ca19065dbeafa Mon Sep 17 00:00:00 2001 From: nek0 Date: Tue, 26 Aug 2014 04:36:21 +0200 Subject: [PATCH] added user slug (just for dodo) --- Foundation.hs | 7 +++++++ config/models | 4 ++-- templates/default-layout.hamlet | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Foundation.hs b/Foundation.hs index c996010..717fefe 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -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: diff --git a/config/models b/config/models index db0b98f..85d4e66 100644 --- a/config/models +++ b/config/models @@ -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 diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 4dd16d5..05edc97 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -2,7 +2,7 @@