web: remove unused /journal/entries view
This commit is contained in:
parent
7138acaec4
commit
ebe0ee184c
@ -1,64 +0,0 @@
|
||||
-- | /journal/entries handlers.
|
||||
|
||||
module Handler.JournalEntriesR where
|
||||
|
||||
import Import
|
||||
|
||||
import Handler.Common
|
||||
import Handler.Post
|
||||
import Handler.Utils
|
||||
|
||||
import Hledger.Data
|
||||
import Hledger.Query
|
||||
import Hledger.Reports
|
||||
import Hledger.Cli.Options
|
||||
import Hledger.Web.Options
|
||||
|
||||
|
||||
-- | The journal entries view, with sidebar.
|
||||
getJournalEntriesR :: Handler Html
|
||||
getJournalEntriesR = do
|
||||
vd@VD{..} <- getViewData
|
||||
staticRootUrl <- (staticRoot . settings) <$> getYesod
|
||||
let
|
||||
sidecontent = sidebar vd
|
||||
title = "Journal entries" ++ if m /= Any then ", filtered" else "" :: String
|
||||
maincontent = entriesReportAsHtml opts vd $ entriesReport (reportopts_ $ cliopts_ opts) Any $ filterJournalTransactions m j
|
||||
defaultLayout $ do
|
||||
setTitle "hledger-web journal"
|
||||
toWidget [hamlet|
|
||||
^{topbar vd}
|
||||
<div#content>
|
||||
<div#sidebar>
|
||||
^{sidecontent}
|
||||
<div#main.journal>
|
||||
<div#maincontent>
|
||||
^{searchform vd}
|
||||
<h2#contenttitle>#{title}
|
||||
^{maincontent}
|
||||
^{addform staticRootUrl vd}
|
||||
^{editform vd}
|
||||
^{importform}
|
||||
|]
|
||||
|
||||
postJournalEntriesR :: Handler Html
|
||||
postJournalEntriesR = handlePost
|
||||
|
||||
-- | Render an "EntriesReport" as html for the journal entries view.
|
||||
entriesReportAsHtml :: WebOpts -> ViewData -> EntriesReport -> HtmlUrl AppRoute
|
||||
entriesReportAsHtml _ vd items = [hamlet|
|
||||
<table.entriesreport>
|
||||
$forall i <- numbered items
|
||||
^{itemAsHtml vd i}
|
||||
|]
|
||||
where
|
||||
itemAsHtml :: ViewData -> (Int, EntriesReportItem) -> HtmlUrl AppRoute
|
||||
itemAsHtml _ (n, t) = [hamlet|
|
||||
<tr.item.#{evenodd}>
|
||||
<td.transaction>
|
||||
<pre>#{txn}
|
||||
|]
|
||||
where
|
||||
evenodd = if even n then "even" else "odd" :: String
|
||||
txn = trimnl $ showTransaction t where trimnl = reverse . dropWhile (=='\n') . reverse
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
/journal JournalR GET POST
|
||||
/register RegisterR GET POST
|
||||
/sidebar SidebarR GET
|
||||
-- /journal/entries JournalEntriesR GET POST
|
||||
-- /journal/edit JournalEditR GET POST
|
||||
--
|
||||
-- /accounts AccountsR GET
|
||||
|
||||
@ -143,7 +143,6 @@ library
|
||||
Settings.Development
|
||||
Handler.Common
|
||||
Handler.JournalEditR
|
||||
Handler.JournalEntriesR
|
||||
Handler.JournalR
|
||||
Handler.Post
|
||||
Handler.RegisterR
|
||||
|
||||
Loading…
Reference in New Issue
Block a user