From 3d2daf3bdfc6a39a488e01fd55af17e74bf65867 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 6 Jul 2010 20:27:41 +0000 Subject: [PATCH] webyesod: cleaner urls when clicking nav links --- Hledger/Cli/Commands/Web.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Hledger/Cli/Commands/Web.hs b/Hledger/Cli/Commands/Web.hs index fd0d86c7b..ace4cd206 100644 --- a/Hledger/Cli/Commands/Web.hs +++ b/Hledger/Cli/Commands/Web.hs @@ -181,7 +181,8 @@ navlinks here a p = [$hamlet| registerlink = navlink here "register" RegisterPage balancelink = navlink here "balance" BalancePage navlink here s dest = [$hamlet|%a.$style$!href=@?u@ $string.s$|] - where u = (dest, [("a", a), ("p", p)]) + where u = (dest, concat [(if null a then [] else [("a", a)]) + ,(if null p then [] else [("p", p)])]) style | here == dest = string "navlinkcurrent" | otherwise = string "navlink"