From 66cb0933877925134724f2a9708da96722f3833b Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 11 Oct 2017 12:44:33 +1100 Subject: [PATCH] Rename module: Entry.Kind -> Model.Entry.Kind --- src/Foundation.hs | 2 +- src/Handler/Common.hs | 2 +- src/Handler/Entries.hs | 5 +++-- src/Handler/Feed.hs | 2 +- src/Model.hs | 2 +- src/{ => Model}/Entry/Kind.hs | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) rename src/{ => Model}/Entry/Kind.hs (97%) diff --git a/src/Foundation.hs b/src/Foundation.hs index d9ca31b..e4cffcd 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -21,8 +21,8 @@ import Yesod.Core.Types (Logger) import qualified Yesod.Core.Unsafe as Unsafe import Package -import Entry.Kind ( EntryKind, allEntryKinds, pluralise ) import Model.Cache ( getCached ) +import Model.Entry.Kind ( EntryKind, allEntryKinds, pluralise ) import Data.Aeson ( encode, object ) import qualified Text.Blaze.Internal as B diff --git a/src/Handler/Common.hs b/src/Handler/Common.hs index 1153b95..31f62a6 100644 --- a/src/Handler/Common.hs +++ b/src/Handler/Common.hs @@ -11,7 +11,7 @@ import Yesod.Sitemap import Import -import Entry.Kind ( EntryKind, allEntryKinds ) +import Model.Entry.Kind ( EntryKind, allEntryKinds ) import Widget.Entry ( entryR ) -- These handlers embed files in the executable at compile time to avoid a diff --git a/src/Handler/Entries.hs b/src/Handler/Entries.hs index 30820c2..950126e 100644 --- a/src/Handler/Entries.hs +++ b/src/Handler/Entries.hs @@ -6,13 +6,14 @@ module Handler.Entries where import Import import Yesod.AtomFeed ( atomLink ) -import qualified Data.Text as T -import qualified Entry.Kind as K import Model.Cache ( getCached ) import Widget.Entry ( entryR, hEntry ) import Widget.Feed ( hFeed ) +import qualified Data.Text as T +import qualified Model.Entry.Kind as K + getEntriesR :: K.EntryKind -> Handler Html getEntriesR kind = do entries <- runDB $ selectList [EntryKind ==. kind] [Desc EntryPublished] diff --git a/src/Handler/Feed.hs b/src/Handler/Feed.hs index 30eedaf..2eaf1a3 100644 --- a/src/Handler/Feed.hs +++ b/src/Handler/Feed.hs @@ -8,7 +8,7 @@ import Data.Time.Clock.POSIX ( posixSecondsToUTCTime ) import Widget.Entry ( entryR ) import qualified Data.Text as T -import qualified Entry.Kind as K +import qualified Model.Entry.Kind as K getFeedR :: Handler TypedContent getFeedR = do diff --git a/src/Model.hs b/src/Model.hs index 154df89..b587826 100644 --- a/src/Model.hs +++ b/src/Model.hs @@ -16,7 +16,7 @@ import Web.Slug ( Slug ) import Text.Mustache ( (~>) ) import qualified Text.Mustache as M -import Entry.Kind ( EntryKind ) +import Model.Entry.Kind ( EntryKind ) -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities diff --git a/src/Entry/Kind.hs b/src/Model/Entry/Kind.hs similarity index 97% rename from src/Entry/Kind.hs rename to src/Model/Entry/Kind.hs index b68488e..0dcfe6e 100644 --- a/src/Entry/Kind.hs +++ b/src/Model/Entry/Kind.hs @@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TemplateHaskell #-} -module Entry.Kind where +module Model.Entry.Kind where import Database.Persist.TH ( derivePersistField ) import Yesod.Core.Dispatch ( PathPiece, toPathPiece, fromPathPiece )