Display posting tags in hledger-web

This commit is contained in:
Saku Laesvuori 2026-01-16 11:48:59 +02:00
parent e5ac735110
commit 10c71cb447
3 changed files with 18 additions and 7 deletions

View File

@ -33,6 +33,7 @@ getJournalR = do
entriesReport rspec j
transactionFrag = transactionFragment j
isVisibleTag = not . isHiddenTagName . fst
isPostingTag account tag = not $ tag `elem` journalInheritedAccountTags j account
defaultLayout $ do
setTitle "päiväkirja - hledger-web"

View File

@ -214,7 +214,7 @@ ul {
padding-left: 2em;
}
.transaction .posting {
.transaction .posting-row {
display: flex;
justify-content: space-between;
}

View File

@ -26,13 +26,23 @@ $if elem AddPermission perms
#{tagValue}
<ul .postings>
$forall Posting { paccount = acc, pamount = amt } <- tpostings torig
$forall Posting { paccount = acc, pamount = amt, ptags = tags } <- tpostings torig
<li .posting>
<div .posting-row>
<div .account>
<a href="@?{acctlink acc}##{tindex torig}" title="#{acc}">
#{elideAccountName 40 acc}
<div .amount style="text-align:right;">
^{mixedAmountAsHtml amt}
$if null $ filter (isPostingTag acc) $ filter isVisibleTag tags
$else
<ul .tags>
$forall (tagName, tagValue) <- filter (isPostingTag acc) $ filter isVisibleTag tags
<li .tag title="#{mconcat [tagName, ": ", tagValue]}">
<div .tag-name>
#{tagName}
<div .tag-value>
#{tagValue}
$if elem AddPermission perms
^{addModal AddR j today}