Add links to URI-valued tags
This commit is contained in:
parent
040cd7a680
commit
d387b7c2ab
@ -8,6 +8,7 @@
|
||||
module Hledger.Web.Handler.JournalR where
|
||||
|
||||
import qualified Data.Text as T -- for journal.hamlet
|
||||
import qualified Text.URI as URI
|
||||
|
||||
import Hledger
|
||||
import Hledger.Cli.CliOptions
|
||||
@ -36,6 +37,7 @@ getJournalR = do
|
||||
transactionFrag = transactionFragment j
|
||||
isVisibleTag = not . isHiddenTagName . fst
|
||||
isPostingTag account tag = not $ tag `elem` journalInheritedAccountTags j account
|
||||
isAbsoluteURI = maybe False URI.isPathAbsolute . URI.mkURI
|
||||
|
||||
defaultLayout $ do
|
||||
setTitle "päiväkirja - hledger-web"
|
||||
|
||||
@ -43,6 +43,9 @@ $if elem AddPermission perms
|
||||
#{tagName}
|
||||
$if not $ T.null $ T.strip tagValue
|
||||
<div .tag-value>
|
||||
$if isAbsoluteURI tagValue
|
||||
<a href="#{tagValue}">#{tagValue}
|
||||
$else
|
||||
#{tagValue}
|
||||
|
||||
<ul .postings>
|
||||
@ -63,6 +66,9 @@ $if elem AddPermission perms
|
||||
#{tagName}
|
||||
$if not $ T.null $ T.strip tagValue
|
||||
<div .tag-value>
|
||||
$if isAbsoluteURI tagValue
|
||||
<a href="#{tagValue}">#{tagValue}
|
||||
$else
|
||||
#{tagValue}
|
||||
|
||||
$if elem AddPermission perms
|
||||
|
||||
Loading…
Reference in New Issue
Block a user