Filter by code by clicking on it

This commit is contained in:
Saku Laesvuori 2026-01-22 21:40:33 +02:00
parent 095c87fbaa
commit 3ee25953f4
3 changed files with 7 additions and 4 deletions

View File

@ -45,7 +45,9 @@ getJournalR = do
escape c
| c `elem` (".[$^()|*+?{\\" :: [Char]) = ['\\', c]
| otherwise = [c]
addTagQuery name value = (JournalR, [("q", qparam <> " \"tag:" <> escapeRegex name <> (if T.null value then "" else "=" <> escapeRegex value) <> "\"")]) -- XXX:is there no way to escape quotes
-- XXX:is there no way to escape quotes in queries
addTagQuery name value = (JournalR, [("q", qparam <> " \"tag:" <> escapeRegex name <> (if T.null value then "" else "=" <> escapeRegex value) <> "\"")])
addCodeQuery code = (JournalR, [("q", qparam <> " \"code:" <> escapeRegex code <> "\"")])
defaultLayout $ do
setTitle "päiväkirja - hledger-web"

View File

@ -191,11 +191,11 @@ ul {
max-width: 10em;
}
.tag-name a {
.tag-name a, .transaction-code a {
color: inherit;
}
.tag-name a:hover {
.tag-name a:hover, .transaction-code a {
text-decoration: underline dotted;
}

View File

@ -25,6 +25,7 @@ $if elem AddPermission perms
<div .status-cleared title="Tarkistettu" aria-label="Tarkistettu">
$if not $ T.null $ tcode torig
<div .transaction-code>
<a href=@?{addCodeQuery $ tcode torig}>
(#{tcode torig})
$if not $ T.null $ T.strip payee
<span .transaction-payee>