From 75f3a3d5d23e00746076d4048c8600c2ce9c2f5b Mon Sep 17 00:00:00 2001 From: Alex Wede Date: Fri, 24 Jul 2015 21:06:41 +0200 Subject: [PATCH 1/3] time version 1.5 und reorder-goals in install.sh --- install.sh | 2 +- neat.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 78a381b..cfcba26 100755 --- a/install.sh +++ b/install.sh @@ -6,4 +6,4 @@ git clone https://github.com/Drezil/yesod-auth-oauth2 cd .. cabal sandbox init cabal sandbox add-source deps/yesod-auth-oauth2 -cabal install --only-dependencies +cabal install --only-dependencies --reorder-goals diff --git a/neat.cabal b/neat.cabal index 06e9f73..cbefeaf 100644 --- a/neat.cabal +++ b/neat.cabal @@ -84,7 +84,7 @@ library , unordered-containers , containers , vector - , time + , time >=1.5 , HTTP , xml-lens , xml-conduit -- 2.34.1 From b739e2190f7de4d2978a4b5208a5986c25f75c14 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Fri, 24 Jul 2015 21:12:18 +0200 Subject: [PATCH 2/3] Tested eve-api --- Handler/Wallet.hs | 18 ++++++++++++++---- install.sh | 2 ++ neat.cabal | 3 ++- templates/default-layout-wrapper.hamlet | 3 ++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Handler/Wallet.hs b/Handler/Wallet.hs index b0332d8..d668a75 100644 --- a/Handler/Wallet.hs +++ b/Handler/Wallet.hs @@ -2,13 +2,23 @@ module Handler.Wallet where import Import +import Eve.Api.Char +import Eve.Api.Types as T + getWalletR :: Handler Html -getWalletR = do +getWalletR = loginOrDo $ (\(uid,user) -> do + man <- getHttpManager <$> ask + apiKey <- runDB $ getBy $ UniqueApiUser uid + acc <- case apiKey of + Just (Entity _ (Api _ k v)) -> do + a <- liftIO $ getAccountBalance man (ApiComplete (T.ApiKey (VCode v) (KeyId k)) (T.CharacterId (userCharId user))) + return (Just a) + Nothing -> return Nothing defaultLayout $ [whamlet|

Transactions in the last xx hours

Statistices for the last xx days - - |] - + #{show acc} + |] + ) diff --git a/install.sh b/install.sh index 78a381b..d095763 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,9 @@ mkdir deps cd deps git clone https://github.com/Drezil/yesod-auth-oauth2 +git clone https://github.com/Drezil/eve-api cd .. cabal sandbox init cabal sandbox add-source deps/yesod-auth-oauth2 +cabal sandbox add-source deps/eve-api cabal install --only-dependencies diff --git a/neat.cabal b/neat.cabal index 06e9f73..2c5f4ff 100644 --- a/neat.cabal +++ b/neat.cabal @@ -84,10 +84,11 @@ library , unordered-containers , containers , vector - , time + , time >= 1.5 , HTTP , xml-lens , xml-conduit + , eve-api executable neat diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 9893adf..8d5d71e 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -34,12 +34,13 @@ $newline never - Brand + NEAT