web: fix journal/register links with --base-url (#235)

This commit is contained in:
Simon Michael 2015-09-27 10:05:20 -10:00
parent 2c3f1b672e
commit df4b43a2b3
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@
module Handler.JournalR where module Handler.JournalR where
import Data.Text (pack)
import Import import Import
import Handler.AddForm import Handler.AddForm
@ -71,7 +72,7 @@ $forall p' <- tpostings t
<td.description> <td.description>
<td.account> <td.account>
&nbsp; &nbsp;
<a href="/register?q=inacct:'#{paccount p'}'##{date}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'} <a href="@?{acctlink (paccount p')}##{date}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'}
<td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'} <td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'}
<tr.#{evenodd}> <tr.#{evenodd}>
<td>&nbsp; <td>&nbsp;
@ -80,6 +81,7 @@ $forall p' <- tpostings t
<td> <td>
|] |]
where where
acctlink a = (RegisterR, [("q", pack $ accountQuery a)])
evenodd = if even n then "even" else "odd" :: String evenodd = if even n then "even" else "odd" :: String
-- datetransition | newm = "newmonth" -- datetransition | newm = "newmonth"
-- | newd = "newday" -- | newd = "newday"

View File

@ -74,7 +74,7 @@ registerItemsHtml _ vd (balancelabel,items) = [hamlet|
itemAsHtml VD{..} (n, newd, newm, _, (torig, tacct, split, acct, amt, bal)) = [hamlet| itemAsHtml VD{..} (n, newd, newm, _, (torig, tacct, split, acct, amt, bal)) = [hamlet|
<tr ##{date} .item.#{evenodd}.#{firstposting}.#{datetransition} title="#{show torig}" style="vertical-align:top;"> <tr ##{date} .item.#{evenodd}.#{firstposting}.#{datetransition} title="#{show torig}" style="vertical-align:top;">
<td.date><a href="/journal##{date}">#{date} <td.date><a href="@{JournalR}##{date}">#{date}
<td.description title="#{show torig}">#{elideRight 30 desc} <td.description title="#{show torig}">#{elideRight 30 desc}
<td.account>#{elideRight 40 acct} <td.account>#{elideRight 40 acct}
<td.amount style="text-align:right; white-space:nowrap;"> <td.amount style="text-align:right; white-space:nowrap;">