From 3486644b442a0800f645ec9ae7f3ce8fe2b3c9cd Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 18 Jul 2015 18:29:46 +0200 Subject: Showing either the payment table or a forbidden message in the UI --- src/server/Application.hs | 13 ++++++------- src/server/View/Page.hs | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/server') diff --git a/src/server/Application.hs b/src/server/Application.hs index b83273f..e480533 100644 --- a/src/server/Application.hs +++ b/src/server/Application.hs @@ -37,10 +37,7 @@ import Model.Payment import View.Page (page) getIndexAction :: ActionM () -getIndexAction = - Secure.loggedAction (\_ -> - html $ page - ) +getIndexAction = html page getUsersAction :: ActionM () getUsersAction = do @@ -48,9 +45,11 @@ getUsersAction = do html . fromString . show $ users getPaymentsAction :: ActionM () -getPaymentsAction = do - payments <- liftIO $ runDb getPayments - json payments +getPaymentsAction = + Secure.loggedAction (\_ -> do + payments <- liftIO $ runDb getPayments + json payments + ) addUserAction :: Text -> Text -> ActionM () addUserAction email name = do diff --git a/src/server/View/Page.hs b/src/server/View/Page.hs index aa4df72..3f4dbf5 100644 --- a/src/server/View/Page.hs +++ b/src/server/View/Page.hs @@ -23,7 +23,6 @@ page = script ! src "/javascripts/client.js" $ "" link ! rel "stylesheet" ! type_ "text/css" ! href "/css/reset.css" link ! rel "stylesheet" ! href "/css/font-awesome/css/font-awesome.min.css" - link ! rel "stylesheet" ! type_ "text/css" ! href "/css/global.css" link ! rel "icon" ! type_ "image/png" ! href "/images/icon.png" H.style $ toHtml globalDesign body $ -- cgit v1.2.3