diff --git a/hledger-web/Application.hs b/hledger-web/Application.hs index ab072754d..ca87b20b3 100644 --- a/hledger-web/Application.hs +++ b/hledger-web/Application.hs @@ -19,9 +19,10 @@ import Yesod.Default.Handlers (getFaviconR, getRobotsR) -- Import all relevant handler modules here. -- Don't forget to add new modules to your cabal file! +import Handler.AddR (postAddR) +import Handler.JournalR (getJournalR) +import Handler.RegisterR (getRegisterR) import Handler.RootR (getRootR) -import Handler.JournalR (getJournalR, postJournalR) -import Handler.RegisterR (getRegisterR, postRegisterR) import Handler.SidebarR (getSidebarR) import Hledger.Data (Journal, nulljournal) diff --git a/hledger-web/Foundation.hs b/hledger-web/Foundation.hs index 52f535412..554042067 100644 --- a/hledger-web/Foundation.hs +++ b/hledger-web/Foundation.hs @@ -6,20 +6,19 @@ module Foundation where import Data.IORef (IORef, readIORef, writeIORef) -import Data.List (isPrefixOf, sort, nub) +import Data.List (isPrefixOf) import Data.Maybe (fromMaybe) import Data.Text (Text) import Data.Time.Calendar (Day) import Network.HTTP.Conduit (Manager) import Text.Blaze (Markup) -import Text.Blaze.Internal (preEscapedString) import Text.Blaze.Html.Renderer.String (renderHtml) import Text.Hamlet (hamletFile) -import Text.JSON import Yesod import Yesod.Static import Yesod.Default.Config +import Handler.AddForm import Settings.StaticFiles import Settings (widgetFile, Extra (..)) #ifndef DEVELOPMENT @@ -233,104 +232,3 @@ getCurrentJournal jref opts d = do -- referentially transparent manner (allowing multiple reads). getLastMessage :: Handler (Maybe Html) getLastMessage = cached getMessage - --- add form dialog, part of the default template - --- | Add transaction form. -addform :: Journal -> HtmlUrl AppRoute -addform j = [hamlet| - -" "<\\/script>" -- #236 - listToJsonValueObjArrayStr as = preEscapedString $ escapeJSSpecialChars $ encode $ JSArray $ map (\a -> JSObject $ toJSObject [("value", showJSON a)]) as - numpostings = 4 - postingnums = [1..numpostings] - filepaths = map fst $ jfiles j - postingfields :: Int -> HtmlUrl AppRoute - postingfields n = [hamlet| -