webyesod: make current navigation link bold
This commit is contained in:
parent
069a70a7b4
commit
2e9efc678a
@ -158,22 +158,24 @@ navbar here a p = [$hamlet|
|
|||||||
^navlinks'^
|
^navlinks'^
|
||||||
^searchform'^
|
^searchform'^
|
||||||
|]
|
|]
|
||||||
where navlinks' = navlinks a p
|
where navlinks' = navlinks here a p
|
||||||
searchform' = searchform here a p
|
searchform' = searchform here a p
|
||||||
|
|
||||||
navlinks :: String -> String -> Hamlet HledgerWebAppRoutes
|
navlinks :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes
|
||||||
navlinks a p = [$hamlet|
|
navlinks here a p = [$hamlet|
|
||||||
#navlinks
|
#navlinks
|
||||||
^transactionslink^ | $
|
^transactionslink^ | $
|
||||||
^registerlink^ | $
|
^registerlink^ | $
|
||||||
^balancelink^
|
^balancelink^
|
||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
transactionslink = navlink "transactions" TransactionsPage
|
transactionslink = navlink here "transactions" TransactionsPage
|
||||||
registerlink = navlink "register" RegisterPage
|
registerlink = navlink here "register" RegisterPage
|
||||||
balancelink = navlink "balance" BalancePage
|
balancelink = navlink here "balance" BalancePage
|
||||||
navlink s dest = [$hamlet|%a.navlink!href=@?u@ $string.s$|]
|
navlink here s dest = [$hamlet|%a.$style$!href=@?u@ $string.s$|]
|
||||||
where u = (dest, [("a", a), ("p", p)])
|
where u = (dest, [("a", a), ("p", p)])
|
||||||
|
style | here == dest = string "navlinkcurrent"
|
||||||
|
| otherwise = string "navlink"
|
||||||
|
|
||||||
searchform :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes
|
searchform :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes
|
||||||
searchform here a p = [$hamlet|
|
searchform here a p = [$hamlet|
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
body { font-family: "helvetica","arial", "sans serif"; margin:0; }
|
body { font-family: "helvetica","arial", "sans serif"; margin:0; }
|
||||||
#navbar { background-color:#eeeeee; border-bottom:2px solid #dddddd; padding:4px 4px 6px 4px; }
|
#navbar { background-color:#eeeeee; border-bottom:2px solid #dddddd; padding:4px 4px 6px 4px; }
|
||||||
#navlinks { display:inline; }
|
#navlinks { display:inline; }
|
||||||
.navlink { font-weight:normal; }
|
.navlink { }
|
||||||
|
.navlinkcurrent { font-weight:bold; }
|
||||||
#searchform { font-size:small; display:inline; margin-left:1em; }
|
#searchform { font-size:small; display:inline; margin-left:1em; }
|
||||||
#resetlink { font-size:small; }
|
#resetlink { font-size:small; }
|
||||||
.toprightlink { font-size:small; margin-left:1em; float:right; }
|
.toprightlink { font-size:small; margin-left:1em; float:right; }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user