19 lines
619 B
Haskell
19 lines
619 B
Haskell
{-# 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
|
|
posts <- runDB $ selectList [PostUserId ==. uid] [Desc PostCreated]
|
|
let userName :: Text
|
|
userName = maybe "UnkownUser" userIdent mayUser
|
|
defaultLayout $ do
|
|
setTitle . toHtml $ show uid <> "'s Timeline"
|
|
$(widgetFile "userTimeline") |