diff --git a/hledger-web/Hledger/Web/Handler/JournalR.hs b/hledger-web/Hledger/Web/Handler/JournalR.hs index fbbf217be..024cc367e 100644 --- a/hledger-web/Hledger/Web/Handler/JournalR.hs +++ b/hledger-web/Hledger/Web/Handler/JournalR.hs @@ -41,6 +41,11 @@ getJournalR = do isPostingTag account tag = not $ tag `elem` journalInheritedAccountTags j account isAbsoluteURI = maybe False URI.isPathAbsolute . URI.mkURI documentRoute = DocumentR . flip StaticRoute [] . T.splitOn "/" + escapeRegex = T.pack . concatMap escape . T.unpack + 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 defaultLayout $ do setTitle "päiväkirja - hledger-web" diff --git a/hledger-web/static/hledger.css b/hledger-web/static/hledger.css index 8fc375367..b9f2b564f 100644 --- a/hledger-web/static/hledger.css +++ b/hledger-web/static/hledger.css @@ -191,6 +191,14 @@ ul { max-width: 10em; } +.tag-name a { + color: inherit; +} + +.tag-name a:hover { + text-decoration: underline dotted; +} + .tag-value { background-color: #eee; padding: 0 6px; diff --git a/hledger-web/templates/journal.hamlet b/hledger-web/templates/journal.hamlet index 3d696743c..c8f022a2e 100644 --- a/hledger-web/templates/journal.hamlet +++ b/hledger-web/templates/journal.hamlet @@ -40,7 +40,8 @@ $if elem AddPermission perms $forall (tagName, tagValue) <- filter isVisibleTag $ ttags torig
  • - #{tagName} + + #{tagName} $if not $ T.null $ T.strip tagValue
    $if isAbsoluteURI tagValue @@ -69,7 +70,8 @@ $if elem AddPermission perms $forall (tagName, tagValue) <- filter (isPostingTag acc) $ filter isVisibleTag tags
  • - #{tagName} + + #{tagName} $if not $ T.null $ T.strip tagValue
    $if isAbsoluteURI tagValue