diff --git a/src/Handler/Home.hs b/src/Handler/Home.hs index 2b6bd5c..ef0da11 100644 --- a/src/Handler/Home.hs +++ b/src/Handler/Home.hs @@ -7,19 +7,20 @@ module Handler.Home where import Import import Widget.Card ( hCard ) +import Widget.Feed ( hFeed ) getHomeR :: Handler Html getHomeR = do - user <- runDB . getBy404 $ UniqueUser "dani" - let name = userFullName . entityVal $ user + userE@(Entity userId user) <- runDB . getBy404 $ UniqueUser "dani" maybeTitle <- asks $ appTitle . appSettings + entries <- runDB $ selectList [EntryAuthorId ==. userId] [Desc EntryPublished] defaultLayout $ do case maybeTitle of Just title -> setTitle $ toHtml title Nothing -> return () toWidgetHead [hamlet| - + |] $(widgetFile "home") diff --git a/templates/home.cassius b/templates/home.cassius new file mode 100644 index 0000000..56442f7 --- /dev/null +++ b/templates/home.cassius @@ -0,0 +1,8 @@ +body > main + display: flex + flex-direction: row-reverse + margin: 2em + > .entries + flex: 1 + > .author + max-width: 30% diff --git a/templates/home.hamlet b/templates/home.hamlet index a472860..695a518 100644 --- a/templates/home.hamlet +++ b/templates/home.hamlet @@ -1 +1,4 @@ -^{hCard user} +
+ ^{hCard userE} +
+ ^{hFeed entries} diff --git a/templates/mf2/h-card.cassius b/templates/mf2/h-card.cassius index a8603ca..ae0a4b4 100644 --- a/templates/mf2/h-card.cassius +++ b/templates/mf2/h-card.cassius @@ -1,7 +1,4 @@ .card.h-card - margin: 2em auto - width: 22rem - ul.profiles list-style: none padding-left: 0