webyesod: cleaner urls when clicking nav links

This commit is contained in:
Simon Michael 2010-07-06 20:27:41 +00:00
parent 2ae94a9011
commit 3d2daf3bdf

View File

@ -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"