lebd/src/Widget/Entry.hs

15 lines
457 B
Haskell

{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Widget.Entry ( entryR, hEntry ) where
import Import
entryR :: Entity Entry -> Route App
entryR (Entity entryId entry) = EntryR (entryKind entry) entryId (entrySlug entry)
hEntry :: Entity Entry -> Widget
hEntry (Entity entryId entry) = do
maybeAuthor <- handlerToWidget . runDB . get . entryAuthorId $ entry
$(widgetFile "mf2/h-entry")