Add permalinks to h-entries

This commit is contained in:
Danielle McLean 2017-10-09 09:02:42 +11:00
parent 9679234062
commit 7cebf92356
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
3 changed files with 8 additions and 7 deletions

View file

@ -7,7 +7,7 @@ import Import
import Web.Slug ( Slug )
import qualified Entry.Kind as K
import Widget.Entry ( hEntry )
import Widget.Entry ( entryR, hEntry )
import Widget.Feed ( hFeed )
getEntriesR :: K.EntryKind -> Handler Html
@ -15,9 +15,6 @@ getEntriesR kind = do
entries <- runDB $ selectList [EntryKind ==. kind] [Desc EntryPublished]
defaultLayout $(widgetFile "entries")
entryR :: Entity Entry -> Route App
entryR (Entity entryId entry) = EntryR (entryKind entry) entryId (entrySlug entry)
checkMatching :: K.EntryKind -> Slug -> Entry -> Bool
checkMatching kind slug entry = (kind == entryKind entry) && (slug == entrySlug entry)