mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
web: make /journal work as a separate view; use "transactions" on both
This commit is contained in:
parent
1d898ed239
commit
20bc969ef0
@ -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';
|
||||
|
@ -3,7 +3,9 @@
|
||||
<div#sidebar
|
||||
^{sidecontent}
|
||||
<div#main.journal
|
||||
^{navlinks vd}
|
||||
<div#navlinks
|
||||
^{navlink vd "transactions" JournalR} | #
|
||||
^{editlinks}
|
||||
<div#maincontent
|
||||
^{searchform vd}
|
||||
^{maincontent}
|
||||
|
@ -1,4 +1,6 @@
|
||||
<div#navlinks
|
||||
^{accountsregisterlink}
|
||||
^{journallink}
|
||||
\ | #
|
||||
^{registerlink}
|
||||
\ | #
|
||||
^{editlinks}
|
||||
|
@ -3,7 +3,9 @@
|
||||
<div#sidebar
|
||||
^{sidecontent}
|
||||
<div#main.register
|
||||
^{navlinks vd}
|
||||
<div#navlinks
|
||||
^{navlink vd "transactions" RegisterR} | #
|
||||
^{editlinks}
|
||||
<div#maincontent
|
||||
^{searchform vd}
|
||||
^{maincontent}
|
||||
|
@ -342,17 +342,19 @@ topbar VD{j=j,msg=msg,today=today} = $(Settings.hamletFile "topbar")
|
||||
where
|
||||
title = takeFileName $ journalFilePath j
|
||||
|
||||
-- | Links to navigate between the main views.
|
||||
navlinks :: ViewData -> 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
|
||||
|
Loading…
Reference in New Issue
Block a user