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
|
module Hledger.Web.Handler.JournalR where
|
||||||
|
|
||||||
import qualified Data.Text as T -- for journal.hamlet
|
import qualified Data.Text as T -- for journal.hamlet
|
||||||
|
import qualified Text.URI as URI
|
||||||
|
|
||||||
import Hledger
|
import Hledger
|
||||||
import Hledger.Cli.CliOptions
|
import Hledger.Cli.CliOptions
|
||||||
@ -36,6 +37,7 @@ getJournalR = do
|
|||||||
transactionFrag = transactionFragment j
|
transactionFrag = transactionFragment j
|
||||||
isVisibleTag = not . isHiddenTagName . fst
|
isVisibleTag = not . isHiddenTagName . fst
|
||||||
isPostingTag account tag = not $ tag `elem` journalInheritedAccountTags j account
|
isPostingTag account tag = not $ tag `elem` journalInheritedAccountTags j account
|
||||||
|
isAbsoluteURI = maybe False URI.isPathAbsolute . URI.mkURI
|
||||||
|
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle "päiväkirja - hledger-web"
|
setTitle "päiväkirja - hledger-web"
|
||||||
|
|||||||
@ -43,7 +43,10 @@ $if elem AddPermission perms
|
|||||||
#{tagName}
|
#{tagName}
|
||||||
$if not $ T.null $ T.strip tagValue
|
$if not $ T.null $ T.strip tagValue
|
||||||
<div .tag-value>
|
<div .tag-value>
|
||||||
#{tagValue}
|
$if isAbsoluteURI tagValue
|
||||||
|
<a href="#{tagValue}">#{tagValue}
|
||||||
|
$else
|
||||||
|
#{tagValue}
|
||||||
|
|
||||||
<ul .postings>
|
<ul .postings>
|
||||||
$forall Posting { paccount = acc, pamount = amt, ptags = tags } <- tpostings torig
|
$forall Posting { paccount = acc, pamount = amt, ptags = tags } <- tpostings torig
|
||||||
@ -63,7 +66,10 @@ $if elem AddPermission perms
|
|||||||
#{tagName}
|
#{tagName}
|
||||||
$if not $ T.null $ T.strip tagValue
|
$if not $ T.null $ T.strip tagValue
|
||||||
<div .tag-value>
|
<div .tag-value>
|
||||||
#{tagValue}
|
$if isAbsoluteURI tagValue
|
||||||
|
<a href="#{tagValue}">#{tagValue}
|
||||||
|
$else
|
||||||
|
#{tagValue}
|
||||||
|
|
||||||
$if elem AddPermission perms
|
$if elem AddPermission perms
|
||||||
^{addModal AddR j today}
|
^{addModal AddR j today}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user