hledger/hledger-web/templates/journal.hamlet

65 lines
2.6 KiB
Plaintext

<h2>
#{title'}
$if elem AddPermission perms
<a #addformlink href="#" role="button" style="cursor:pointer; margin-top:1em;"
data-toggle="modal" data-target="#addmodal" title="Lisää uusi tapahtuma kirjanpitoon.">
Kirjaa tapahtuma
<ol .transactionsreport .list-unstyled>
$forall torig <- items
<li .transaction ##{transactionFrag torig}>
<div .title title="#{showTransaction torig}">
$with (payee, note) <- payeeAndNoteFromDescription' $ tdescription torig
<time .date datetime="#{show (tdate torig)}" nowrap>
#{show (tdate torig)}
<div .status>
$case tstatus torig
$of Unmarked
<div .status-unmarked title="Tarkistamaton" aria-label="Tarkistamaton">
$of Pending
<div .status-pending title="Kesken" aria-label="Kesken">
$of Cleared
<div .status-cleared title="Tarkistettu" aria-label="Tarkistettu">
$if not $ T.null $ tcode torig
<div .transaction-code>
(#{tcode torig})
$if not $ T.null $ T.strip payee
<div .transaction-payee>
#{textElideRight 60 payee}
$if not $ T.null $ T.strip note
<div .transaction-note>
#{textElideRight 60 note}
$if null $ filter isVisibleTag $ ttags torig
$else
<ul .tags>
$forall (tagName, tagValue) <- filter isVisibleTag $ ttags torig
<li .tag title="#{mconcat [tagName, ": ", tagValue]}">
<div .tag-name>
#{tagName}
<div .tag-value>
#{tagValue}
<ul .postings>
$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}