2017-06-29 15:08:27 +00:00
|
|
|
{-# LANGUAGE NoImplicitPrelude #-}
|
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
{-# LANGUAGE TypeFamilies #-}
|
|
|
|
{-# LANGUAGE TypeFamilies #-}
|
|
|
|
module Handler.UserTimeline where
|
|
|
|
|
|
|
|
import Import
|
|
|
|
|
|
|
|
getUserTimelineR :: UserId -> Handler Html
|
|
|
|
getUserTimelineR uid = do
|
|
|
|
mayUser <- runDB $ get uid
|
2017-07-04 21:13:57 +00:00
|
|
|
posts <- runDB $ selectList [PostAuthor ==. uid] [Desc PostCreated]
|
2017-06-29 15:08:27 +00:00
|
|
|
let userName :: Text
|
|
|
|
userName = maybe "UnkownUser" userIdent mayUser
|
|
|
|
defaultLayout $ do
|
|
|
|
setTitle . toHtml $ show uid <> "'s Timeline"
|
2017-07-04 21:13:57 +00:00
|
|
|
$(widgetFile "userTimeline")
|