diff --git a/hledger-web/.hledger/web/static/hledger.js b/hledger-web/.hledger/web/static/hledger.js index a285c11cb..a3dce01a8 100644 --- a/hledger-web/.hledger/web/static/hledger.js +++ b/hledger-web/.hledger/web/static/hledger.js @@ -30,8 +30,7 @@ function searchformToggle() { var elink = document.getElementById('editformlink'); var flink = document.getElementById('searchformlink'); var ilink = document.getElementById('importformlink'); - var jlink = document.getElementById('journallink'); - var rlink = document.getElementById('postingslink'); + var tlink = document.getElementById('transactionslink'); if (f.style.display == 'none') { flink.style['font-weight'] = 'bold'; @@ -53,15 +52,13 @@ function addformToggle(ev) { var elink = document.getElementById('editformlink'); var flink = document.getElementById('searchformlink'); var ilink = document.getElementById('importformlink'); - var jlink = document.getElementById('journallink'); - var rlink = document.getElementById('postingslink'); + var tlink = document.getElementById('transactionslink'); if (a.style.display == 'none') { if (alink) alink.style['font-weight'] = 'bold'; if (elink) elink.style['font-weight'] = 'normal'; if (ilink) ilink.style['font-weight'] = 'normal'; - if (jlink) jlink.style['font-weight'] = 'normal'; - if (rlink) rlink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'normal'; if (a) a.style.display = 'block'; if (e) e.style.display = 'none'; if (i) i.style.display = 'none'; @@ -70,6 +67,7 @@ function addformToggle(ev) { if (alink) alink.style['font-weight'] = 'normal'; if (elink) elink.style['font-weight'] = 'normal'; if (ilink) ilink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'bold'; if (a) a.style.display = 'none'; if (e) e.style.display = 'none'; if (i) i.style.display = 'none'; @@ -89,15 +87,13 @@ function editformToggle(ev) { var elink = document.getElementById('editformlink'); var flink = document.getElementById('searchformlink'); var ilink = document.getElementById('importformlink'); - var jlink = document.getElementById('journallink'); - var rlink = document.getElementById('postingslink'); + var tlink = document.getElementById('transactionslink'); if (e.style.display == 'none') { if (alink) alink.style['font-weight'] = 'normal'; if (elink) elink.style['font-weight'] = 'bold'; if (ilink) ilink.style['font-weight'] = 'normal'; - if (jlink) jlink.style['font-weight'] = 'normal'; - if (rlink) rlink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'normal'; if (a) a.style.display = 'none'; if (i) i.style.display = 'none'; if (c) c.style.display = 'none'; @@ -107,6 +103,7 @@ function editformToggle(ev) { if (alink) alink.style['font-weight'] = 'normal'; if (elink) elink.style['font-weight'] = 'normal'; if (ilink) ilink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'bold'; if (a) a.style.display = 'none'; if (e) e.style.display = 'none'; if (i) i.style.display = 'none'; @@ -149,15 +146,13 @@ function importformToggle(ev) { var elink = document.getElementById('editformlink'); var flink = document.getElementById('searchformlink'); var ilink = document.getElementById('importformlink'); - var jlink = document.getElementById('journallink'); - var rlink = document.getElementById('postingslink'); + var tlink = document.getElementById('transactionslink'); if (i.style.display == 'none') { if (alink) alink.style['font-weight'] = 'normal'; if (elink) elink.style['font-weight'] = 'normal'; if (ilink) ilink.style['font-weight'] = 'bold'; - if (jlink) jlink.style['font-weight'] = 'normal'; - if (rlink) rlink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'normal'; if (a) a.style.display = 'none'; if (e) e.style.display = 'none'; if (i) i.style.display = 'block'; @@ -166,6 +161,7 @@ function importformToggle(ev) { if (alink) alink.style['font-weight'] = 'normal'; if (elink) elink.style['font-weight'] = 'normal'; if (ilink) ilink.style['font-weight'] = 'normal'; + if (tlink) tlink.style['font-weight'] = 'bold'; if (a) a.style.display = 'none'; if (e) e.style.display = 'none'; if (i) i.style.display = 'none'; diff --git a/hledger-web/.hledger/web/templates/journal.hamlet b/hledger-web/.hledger/web/templates/journal.hamlet index fdb888e15..8b8087e60 100644 --- a/hledger-web/.hledger/web/templates/journal.hamlet +++ b/hledger-web/.hledger/web/templates/journal.hamlet @@ -3,7 +3,9 @@ Hamlet AppRoute -navlinks vd = $(Settings.hamletFile "navlinks") - where - accountsjournallink = navlink vd "transactions" JournalR - accountsregisterlink = navlink vd "postings" RegisterR - navlink :: ViewData -> String -> AppRoute -> Hamlet AppRoute - navlink VD{here=here,q=q} s dest = $(Settings.hamletFile "navlink") - where u = (dest, if null q then [] else [("q", pack q)]) - style | dest == here = "navlinkcurrent" - | otherwise = "navlink" :: Text +-- -- | Links to navigate between the main views. +-- navlinks :: ViewData -> Hamlet AppRoute +-- navlinks vd = $(Settings.hamletFile "navlinks") +-- where +-- journallink = navlink vd "transactions" JournalR +-- registerlink = navlink vd "postings" RegisterR + +-- | Navigation link, preserving parameters and possibly highlighted. +navlink :: ViewData -> String -> AppRoute -> Hamlet AppRoute +navlink VD{here=here,q=q} s dest = $(Settings.hamletFile "navlink") + where u = (dest, if null q then [] else [("q", pack q)]) + style | dest == here = "navlinkcurrent" + | otherwise = "navlink" :: Text -- | Links to the various journal editing forms. editlinks :: Hamlet AppRoute