From 98767bb01cb815080db2823f06aa6ed83033612d Mon Sep 17 00:00:00 2001 From: nek0 Date: Wed, 2 Mar 2016 09:49:48 +0100 Subject: [PATCH] reverting tinkering --- Foundation.hs | 28 ++++++++++++++-------------- Helper.hs | 18 ------------------ 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/Foundation.hs b/Foundation.hs index 522ecf9..6458f3d 100755 --- a/Foundation.hs +++ b/Foundation.hs @@ -69,20 +69,20 @@ renderLayout widget = do route <- getCurrentRoute mmsg <- getMessage msu <- lookupSession "userId" - -- username <- case msu of - -- Just a -> do - -- let uId = getUserIdFromText a - -- user <- runDB $ getJust uId - -- return $ userName user - -- Nothing -> - -- return ("" :: T.Text) - -- slug <- case msu of - -- Just a -> do - -- let uId = getUserIdFromText a - -- user <- runDB $ getJust uId - -- return $ userSlug user - -- Nothing -> - -- return ("" :: T.Text) + username <- case msu of + Just a -> do + let uId = getUserIdFromText a + user <- runDB $ getJust uId + return $ userName user + Nothing -> + return ("" :: T.Text) + slug <- case msu of + Just a -> do + let uId = getUserIdFromText a + user <- runDB $ getJust uId + return $ userSlug user + Nothing -> + return ("" :: T.Text) let block = appSignupBlocked $ appSettings master -- We break up the default layout into two components: diff --git a/Helper.hs b/Helper.hs index f49f88f..a3db331 100755 --- a/Helper.hs +++ b/Helper.hs @@ -41,24 +41,6 @@ import Network.HTTP.Client import Network.HTTP.Types.Status as S import Control.Monad (when) -getUsername :: Maybe T.Text -> Handler (Maybe T.Text) -getUsername mtid = - getSkel mtid userName - -getSlug :: Maybe T.Text -> Handler (Maybe T.Text) -getSlug mtid = - getSkel mtid userSlug - -getSkel :: Maybe T.Text -> (User -> a) -> Handler (Maybe a) -getSkel mtid fun = - case mtid of - Just tid -> do - let uId = getUserIdFromText tid - user <- runDB $ getJust uId - return $ Just $ fun user - Nothing -> - return Nothing - getUserIdFromText :: T.Text -> UserId getUserIdFromText tempUserId = case key of