webyesod: make current navigation link bold

This commit is contained in:
Simon Michael 2010-07-06 20:08:02 +00:00
parent 069a70a7b4
commit 2e9efc678a
2 changed files with 11 additions and 8 deletions

View File

@ -158,22 +158,24 @@ navbar here a p = [$hamlet|
^navlinks'^
^searchform'^
|]
where navlinks' = navlinks a p
where navlinks' = navlinks here a p
searchform' = searchform here a p
navlinks :: String -> String -> Hamlet HledgerWebAppRoutes
navlinks a p = [$hamlet|
navlinks :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes
navlinks here a p = [$hamlet|
#navlinks
^transactionslink^ | $
^registerlink^ | $
^balancelink^
|]
where
transactionslink = navlink "transactions" TransactionsPage
registerlink = navlink "register" RegisterPage
balancelink = navlink "balance" BalancePage
navlink s dest = [$hamlet|%a.navlink!href=@?u@ $string.s$|]
transactionslink = navlink here "transactions" TransactionsPage
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)])
style | here == dest = string "navlinkcurrent"
| otherwise = string "navlink"
searchform :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes
searchform here a p = [$hamlet|

View File

@ -3,7 +3,8 @@
body { font-family: "helvetica","arial", "sans serif"; margin:0; }
#navbar { background-color:#eeeeee; border-bottom:2px solid #dddddd; padding:4px 4px 6px 4px; }
#navlinks { display:inline; }
.navlink { font-weight:normal; }
.navlink { }
.navlinkcurrent { font-weight:bold; }
#searchform { font-size:small; display:inline; margin-left:1em; }
#resetlink { font-size:small; }
.toprightlink { font-size:small; margin-left:1em; float:right; }