From 1725e252b7bd6bec9faecb0249961343bb27afb0 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Thu, 24 Oct 2013 15:33:27 -0400 Subject: vacation report, belated commit --- Application.hs | 1 + Foundation.hs | 2 ++ config/routes | 1 + sflctimekeeper.cabal | 2 ++ templates/pagenav.hamlet | 18 ++++++++++-------- templates/userpage.hamlet | 3 +++ 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Application.hs b/Application.hs index dfd717d..a0e9257 100644 --- a/Application.hs +++ b/Application.hs @@ -25,6 +25,7 @@ import Handler.Home import Handler.Category import Handler.Employment import Handler.User +import Handler.Vacation -- This line actually creates our YesodDispatch instance. It is the second half -- of the call to mkYesodData which occurs in Foundation.hs. Please see the diff --git a/Foundation.hs b/Foundation.hs index 15034a1..171d414 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -126,6 +126,8 @@ instance Yesod App where isAuthorized (CategoryR _) False = return Authorized isAuthorized (EmploymentR e) True = isAdmin isAuthorized (EmploymentR _) False = return Authorized + isAuthorized (VacationR u) True = isUser u -- this should be impossible + isAuthorized (VacationR u) False = isUserOrAdmin u isAuthorized _ _ = return Authorized isUser :: UserId -> GHandler s App AuthResult diff --git a/config/routes b/config/routes index a71d15d..ecec1de 100644 --- a/config/routes +++ b/config/routes @@ -8,3 +8,4 @@ /user/#UserId UserR GET POST /category/#TimeCategoryId CategoryR GET POST /employment/#EmploymentId EmploymentR GET POST +/vacation/#UserId VacationR GET diff --git a/sflctimekeeper.cabal b/sflctimekeeper.cabal index f3dd83a..4478ed0 100644 --- a/sflctimekeeper.cabal +++ b/sflctimekeeper.cabal @@ -32,6 +32,7 @@ library Handler.User Handler.Category Handler.Employment + Handler.Vacation Auth.Proxied PTO @@ -89,6 +90,7 @@ library , case-insensitive , time , wai + , transformers executable sflctimekeeper if flag(library-only) diff --git a/templates/pagenav.hamlet b/templates/pagenav.hamlet index ae38a2d..17f4ef0 100644 --- a/templates/pagenav.hamlet +++ b/templates/pagenav.hamlet @@ -1,10 +1,12 @@

(page #{pageNumber}/#{pages}): -$if doPrev - Prev -$else - Prev -$if doNext - Next -$else - Next +

+ $if doPrev + Prev + $else + Prev + / + $if doNext + Next + $else + Next diff --git a/templates/userpage.hamlet b/templates/userpage.hamlet index 4205d2c..504bd22 100644 --- a/templates/userpage.hamlet +++ b/templates/userpage.hamlet @@ -33,3 +33,6 @@ $else #{e} ^{pageNavWidget} + +

+ PTO report -- cgit v1.2.1