diff --git a/Handler/Stock.hs b/Handler/Stock.hs index c334ed9..fae2dee 100644 --- a/Handler/Stock.hs +++ b/Handler/Stock.hs @@ -3,4 +3,19 @@ module Handler.Stock where import Import getStockR :: Handler Html -getStockR = error "Not yet implemented: getStockR" +getStockR = loginOrDo (\(uid,user) -> do + items <- runDB $ selectList [TransactionUser ==. uid, TransactionInStock >. 0] [Asc TransactionTypeName] + defaultLayout $ [whamlet| +
Item name + | Quantity + | Buy Price + $forall Entity _ t <- items + |
---|---|---|
#{transactionTypeName t} + | #{transactionInStock t} + | #{transactionPriceCents t} + |] + ) diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 918a40e..d2d9929 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -41,6 +41,7 @@ $newline never |