web: add closing angle brackets which yesod 1.0 requires

This commit is contained in:
Simon Michael 2012-04-01 20:30:44 +00:00
parent 396f8cfa9b
commit bb131f1b8c
2 changed files with 124 additions and 124 deletions

View File

@ -71,20 +71,20 @@ instance Yesod App where
widget widget
hamletToRepHtml [hamlet| hamletToRepHtml [hamlet|
$doctype 5 $doctype 5
<html <html>
<head <head>
<title>#{pageTitle pc} <title>#{pageTitle pc}
^{pageHead pc} ^{pageHead pc}
<meta http-equiv=Content-Type content="text/html; charset=utf-8" <meta http-equiv=Content-Type content="text/html; charset=utf-8">
<script type=text/javascript src=@{StaticR jquery_js} <script type=text/javascript src=@{StaticR jquery_js}>
<script type=text/javascript src=@{StaticR jquery_url_js} <script type=text/javascript src=@{StaticR jquery_url_js}>
<script type=text/javascript src=@{StaticR jquery_flot_js} <script type=text/javascript src=@{StaticR jquery_flot_js}>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]--> <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
<script type=text/javascript src=@{StaticR dhtmlxcommon_js} <script type=text/javascript src=@{StaticR dhtmlxcommon_js}>
<script type=text/javascript src=@{StaticR dhtmlxcombo_js} <script type=text/javascript src=@{StaticR dhtmlxcombo_js}>
<script type=text/javascript src=@{StaticR hledger_js} <script type=text/javascript src=@{StaticR hledger_js}>
<link rel=stylesheet type=text/css media=all href=@{StaticR style_css} <link rel=stylesheet type=text/css media=all href=@{StaticR style_css}>
<body <body>
^{pageBody pc} ^{pageBody pc}
|] |]

View File

@ -103,11 +103,11 @@ getJournalR = do
setTitle "hledger-web journal" setTitle "hledger-web journal"
addWidget $ toWidget [hamlet| addWidget $ toWidget [hamlet|
^{topbar vd} ^{topbar vd}
<div#content <div#content>
<div#sidebar <div#sidebar>
^{sidecontent} ^{sidecontent}
<div#main.register <div#main.register>
<div#maincontent <div#maincontent>
<h2#contenttitle>#{title} <h2#contenttitle>#{title}
^{searchform vd} ^{searchform vd}
^{maincontent} ^{maincontent}
@ -128,11 +128,11 @@ getJournalEntriesR = do
setTitle "hledger-web journal" setTitle "hledger-web journal"
addWidget $ toWidget [hamlet| addWidget $ toWidget [hamlet|
^{topbar vd} ^{topbar vd}
<div#content <div#content>
<div#sidebar <div#sidebar>
^{sidecontent} ^{sidecontent}
<div#main.journal <div#main.journal>
<div#maincontent <div#maincontent>
<h2#contenttitle>#{title} <h2#contenttitle>#{title}
^{searchform vd} ^{searchform vd}
^{maincontent} ^{maincontent}
@ -174,11 +174,11 @@ getRegisterR = do
setTitle "hledger-web register" setTitle "hledger-web register"
addWidget $ toWidget [hamlet| addWidget $ toWidget [hamlet|
^{topbar vd} ^{topbar vd}
<div#content <div#content>
<div#sidebar <div#sidebar>
^{sidecontent} ^{sidecontent}
<div#main.register <div#main.register>
<div#maincontent <div#maincontent>
<h2#contenttitle>#{title} <h2#contenttitle>#{title}
^{searchform vd} ^{searchform vd}
^{maincontent} ^{maincontent}
@ -228,28 +228,28 @@ sidebar vd@VD{..} = accountsReportAsHtml opts vd $ accountsReport (reportopts_ $
accountsReportAsHtml :: WebOpts -> ViewData -> AccountsReport -> HtmlUrl AppRoute accountsReportAsHtml :: WebOpts -> ViewData -> AccountsReport -> HtmlUrl AppRoute
accountsReportAsHtml _ vd@VD{..} (items',total) = accountsReportAsHtml _ vd@VD{..} (items',total) =
[hamlet| [hamlet|
<div#accountsheading <div#accountsheading>
<a#accounts-toggle-link.togglelink href="#" title="Toggle sidebar">[+] <a#accounts-toggle-link.togglelink href="#" title="Toggle sidebar">[+]
<div#accounts <div#accounts>
<table.balancereport> <table.balancereport>
<tr <tr>
<td.add colspan=3 <td.add colspan=3>
<br> <br>
<a#addformlink href="#" onclick="return addformToggle(event)" title="Add a new transaction to the journal">Add a transaction.. <a#addformlink href="#" onclick="return addformToggle(event)" title="Add a new transaction to the journal">Add a transaction..
<tr.item :allaccts:.inacct <tr.item :allaccts:.inacct>
<td.journal colspan=3 <td.journal colspan=3>
<br> <br>
<a href=@{JournalR} title="Show all transactions in journal format">Journal <a href=@{JournalR} title="Show all transactions in journal format">Journal
<span.hoverlinks <span.hoverlinks>
&nbsp; &nbsp;
<a href=@{JournalEntriesR} title="Show journal entries">entries <a href=@{JournalEntriesR} title="Show journal entries">entries
&nbsp; &nbsp;
<a#editformlink href="#" onclick="return editformToggle(event)" title="Edit the journal"> <a#editformlink href="#" onclick="return editformToggle(event)" title="Edit the journal">
edit edit
<tr <tr>
<td colspan=3 <td colspan=3>
<br> <br>
Accounts Accounts
@ -270,11 +270,11 @@ accountsReportAsHtml _ vd@VD{..} (items',total) =
items = items' -- maybe items' (\m -> filter (matchesAccount m . \(a,_,_,_)->a) items') showacctmatcher items = items' -- maybe items' (\m -> filter (matchesAccount m . \(a,_,_,_)->a) items') showacctmatcher
itemAsHtml :: ViewData -> AccountsReportItem -> HtmlUrl AppRoute itemAsHtml :: ViewData -> AccountsReportItem -> HtmlUrl AppRoute
itemAsHtml _ (acct, adisplay, aindent, abal) = [hamlet| itemAsHtml _ (acct, adisplay, aindent, abal) = [hamlet|
<tr.item.#{inacctclass} <tr.item.#{inacctclass}>
<td.account.#{depthclass} <td.account.#{depthclass}>
#{indent} #{indent}
<a href="@?{acctquery}" title="Show transactions in this account, including subaccounts">#{adisplay} <a href="@?{acctquery}" title="Show transactions in this account, including subaccounts">#{adisplay}
<span.hoverlinks <span.hoverlinks>
$if hassubs $if hassubs
&nbsp; &nbsp;
<a href="@?{acctonlyquery}" title="Show transactions in this account only">only <a href="@?{acctonlyquery}" title="Show transactions in this account only">only
@ -326,8 +326,8 @@ entriesReportAsHtml _ vd items = [hamlet|
-- | Render a "TransactionsReport" as html for the formatted journal view. -- | Render a "TransactionsReport" as html for the formatted journal view.
journalTransactionsReportAsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute journalTransactionsReportAsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute
journalTransactionsReportAsHtml _ vd (_,items) = [hamlet| journalTransactionsReportAsHtml _ vd (_,items) = [hamlet|
<table.journalreport <table.journalreport>
<tr.headings <tr.headings>
<th.date align=left>Date <th.date align=left>Date
<th.description align=left>Description <th.description align=left>Description
<th.account align=left>Accounts <th.account align=left>Accounts
@ -339,16 +339,16 @@ journalTransactionsReportAsHtml _ vd (_,items) = [hamlet|
-- .#{datetransition} -- .#{datetransition}
itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute
itemAsHtml VD{..} (n, _, _, _, (t, _, split, _, amt, _)) = [hamlet| itemAsHtml VD{..} (n, _, _, _, (t, _, split, _, amt, _)) = [hamlet|
<tr.item.#{evenodd}.#{firstposting} <tr.item.#{evenodd}.#{firstposting}>
<td.date>#{date} <td.date>#{date}
<td.description colspan=2 title="#{show t}">#{elideRight 60 desc} <td.description colspan=2 title="#{show t}">#{elideRight 60 desc}
<td.amount align=right> <td.amount align=right>
$if showamt $if showamt
#{mixedAmountAsHtml amt} #{mixedAmountAsHtml amt}
$forall p' <- tpostings t $forall p' <- tpostings t
<tr.item.#{evenodd}.posting <tr.item.#{evenodd}.posting>
<td.date <td.date>
<td.description <td.description>
<td.account>&nbsp;<a href="@?{accountUrl here $ paccount p'}" title="Show transactions in #{paccount p'}">#{elideRight 40 $ paccount p'} <td.account>&nbsp;<a href="@?{accountUrl here $ paccount p'}" title="Show transactions in #{paccount p'}">#{elideRight 40 $ paccount p'}
<td.amount align=right>#{mixedAmountAsHtml $ pamount p'} <td.amount align=right>#{mixedAmountAsHtml $ pamount p'}
|] |]
@ -371,8 +371,8 @@ registerReportHtml opts vd r@(_,items) = [hamlet|
-- Generate html for a transaction list from an "TransactionsReport". -- Generate html for a transaction list from an "TransactionsReport".
registerItemsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute registerItemsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute
registerItemsHtml _ vd (balancelabel,items) = [hamlet| registerItemsHtml _ vd (balancelabel,items) = [hamlet|
<table.registerreport <table.registerreport>
<tr.headings <tr.headings>
<th.date align=left>Date <th.date align=left>Date
<th.description align=left>Description <th.description align=left>Description
<th.account align=left>To/From Account <th.account align=left>To/From Account
@ -389,23 +389,23 @@ registerItemsHtml _ vd (balancelabel,items) = [hamlet|
-- filtering = m /= Any -- filtering = m /= Any
itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute
itemAsHtml VD{..} (n, newd, newm, _, (t, _, split, acct, amt, bal)) = [hamlet| itemAsHtml VD{..} (n, newd, newm, _, (t, _, split, acct, amt, bal)) = [hamlet|
<tr.item.#{evenodd}.#{firstposting}.#{datetransition} <tr.item.#{evenodd}.#{firstposting}.#{datetransition}>
<td.date>#{date} <td.date>#{date}
<td.description title="#{show t}">#{elideRight 30 desc} <td.description title="#{show t}">#{elideRight 30 desc}
<td.account title="#{show t}" <td.account title="#{show t}">
<a <a>
#{elideRight 40 acct} #{elideRight 40 acct}
&nbsp; &nbsp;
<a.postings-toggle-link.togglelink href="#" title="Toggle all postings" <a.postings-toggle-link.togglelink href="#" title="Toggle all postings">
[+] [+]
<td.amount align=right> <td.amount align=right>
$if showamt $if showamt
#{mixedAmountAsHtml amt} #{mixedAmountAsHtml amt}
<td.balance align=right>#{mixedAmountAsHtml bal} <td.balance align=right>#{mixedAmountAsHtml bal}
$forall p' <- tpostings t $forall p' <- tpostings t
<tr.item.#{evenodd}.posting style=#{postingsdisplaystyle} <tr.item.#{evenodd}.posting style=#{postingsdisplaystyle}>
<td.date <td.date>
<td.description <td.description>
<td.account>&nbsp;<a href="@?{accountUrl here $ paccount p'}" title="Show transactions in #{paccount p'}">#{elideRight 40 $ paccount p'} <td.account>&nbsp;<a href="@?{accountUrl here $ paccount p'}" title="Show transactions in #{paccount p'}">#{elideRight 40 $ paccount p'}
<td.amount align=right>#{mixedAmountAsHtml $ pamount p'} <td.amount align=right>#{mixedAmountAsHtml $ pamount p'}
<td.balance align=right> <td.balance align=right>
@ -450,7 +450,7 @@ registerChartHtml items =
} }
); );
}); });
<div#register-chart style="width:600px;height:100px; margin-bottom:1em;" <div#register-chart style="width:600px;height:100px; margin-bottom:1em;">
|] |]
-- stringIfLongerThan :: Int -> String -> String -- stringIfLongerThan :: Int -> String -> String
@ -635,8 +635,8 @@ handleImport = do
-- | Global toolbar/heading area. -- | Global toolbar/heading area.
topbar :: ViewData -> HtmlUrl AppRoute topbar :: ViewData -> HtmlUrl AppRoute
topbar VD{..} = [hamlet| topbar VD{..} = [hamlet|
<div#topbar <div#topbar>
<a.topleftlink href=#{hledgerorgurl} title="More about hledger" <a.topleftlink href=#{hledgerorgurl} title="More about hledger">
hledger-web hledger-web
<br /> <br />
#{version} #{version}
@ -676,26 +676,26 @@ helplink topic label = [hamlet|
-- | Search form for entering custom queries to filter journal data. -- | Search form for entering custom queries to filter journal data.
searchform :: ViewData -> HtmlUrl AppRoute searchform :: ViewData -> HtmlUrl AppRoute
searchform VD{..} = [hamlet| searchform VD{..} = [hamlet|
<div#searchformdiv <div#searchformdiv>
<form#searchform.form method=GET <form#searchform.form method=GET>
<table <table>
<tr <tr>
<td <td>
Search: Search:
\ # \ #
<td <td>
<input name=q size=70 value=#{q} <input name=q size=70 value=#{q}>
<input type=submit value="Search" <input type=submit value="Search">
$if filtering $if filtering
\ # \ #
<span.showall <span.showall>
<a href=@{here}>clear search <a href=@{here}>clear search
\ # \ #
<a#search-help-link href="#" title="Toggle search help">help <a#search-help-link href="#" title="Toggle search help">help
<tr <tr>
<td <td>
<td <td>
<div#search-help.help style="display:none;" <div#search-help.help style="display:none;">
Leave blank to see journal (all transactions), or click account links to see transactions under that account. Leave blank to see journal (all transactions), or click account links to see transactions under that account.
<br> <br>
Transactions/postings may additionally be filtered by: Transactions/postings may additionally be filtered by:
@ -734,37 +734,37 @@ addform vd@VD{..} = [hamlet|
/* desccombo.setOptionHeight(200); */ /* desccombo.setOptionHeight(200); */
}); });
<form#addform method=POST style=display:none; <form#addform method=POST style=display:none;>
<h2#contenttitle>#{title} <h2#contenttitle>#{title}
<table.form <table.form>
<tr <tr>
<td colspan=4 <td colspan=4>
<table <table>
<tr#descriptionrow <tr#descriptionrow>
<td <td>
Date: Date:
<td <td>
<input.textinput size=15 name=date value=#{date} <input.textinput size=15 name=date value=#{date}>
<td style=padding-left:1em; <td style=padding-left:1em;>
Description: Description:
<td <td>
<select id=description name=description <select id=description name=description>
<option <option>
$forall d <- descriptions $forall d <- descriptions
<option value=#{d}>#{d} <option value=#{d}>#{d}
<tr.helprow <tr.helprow>
<td <td>
<td <td>
<span.help>#{datehelp} # <span.help>#{datehelp} #
<td <td>
<td <td>
<span.help>#{deschelp} <span.help>#{deschelp}
^{postingfields vd 1} ^{postingfields vd 1}
^{postingfields vd 2} ^{postingfields vd 2}
<tr#addbuttonrow <tr#addbuttonrow>
<td colspan=4 <td colspan=4>
<input type=hidden name=action value=add <input type=hidden name=action value=add>
<input type=submit name=submit value="add transaction" <input type=submit name=submit value="add transaction">
$if manyfiles $if manyfiles
\ to: ^{journalselect $ files j} \ to: ^{journalselect $ files j}
\ or # \ or #
@ -779,20 +779,20 @@ addform vd@VD{..} = [hamlet|
manyfiles = (length $ files j) > 1 manyfiles = (length $ files j) > 1
postingfields :: ViewData -> Int -> HtmlUrl AppRoute postingfields :: ViewData -> Int -> HtmlUrl AppRoute
postingfields _ n = [hamlet| postingfields _ n = [hamlet|
<tr#postingrow <tr#postingrow>
<td align=right>#{acctlabel}: <td align=right>#{acctlabel}:
<td <td>
<select id=#{acctvar} name=#{acctvar} <select id=#{acctvar} name=#{acctvar}>
<option <option>
$forall a <- acctnames $forall a <- acctnames
<option value=#{a} :shouldselect a:selected>#{a} <option value=#{a} :shouldselect a:selected>#{a}>
^{amtfield} ^{amtfield}
<tr.helprow <tr.helprow>
<td <td>
<td <td>
<span.help>#{accthelp} <span.help>#{accthelp}
<td <td>
<td <td>
<span.help>#{amthelp} <span.help>#{amthelp}
|] |]
where where
@ -805,10 +805,10 @@ addform vd@VD{..} = [hamlet|
| n == 1 = ("To account" | n == 1 = ("To account"
,"eg: expenses:food" ,"eg: expenses:food"
,[hamlet| ,[hamlet|
<td style=padding-left:1em; <td style=padding-left:1em;>
Amount: Amount:
<td <td>
<input.textinput size=15 name=#{amtvar} value="" <input.textinput size=15 name=#{amtvar} value="">
|] |]
,"eg: $6" ,"eg: $6"
) )
@ -821,27 +821,27 @@ addform vd@VD{..} = [hamlet|
-- | Edit journal form. -- | Edit journal form.
editform :: ViewData -> HtmlUrl AppRoute editform :: ViewData -> HtmlUrl AppRoute
editform VD{..} = [hamlet| editform VD{..} = [hamlet|
<form#editform method=POST style=display:none; <form#editform method=POST style=display:none;>
<h2#contenttitle>#{title} <h2#contenttitle>#{title}>
<table.form <table.form>
$if manyfiles $if manyfiles
<tr <tr>
<td colspan=2 <td colspan=2>
Editing ^{journalselect $ files j} Editing ^{journalselect $ files j}
<tr <tr>
<td colspan=2 <td colspan=2>
<!-- XXX textarea ids are unquoted journal file paths here, not valid html --> <!-- XXX textarea ids are unquoted journal file paths here, not valid html -->
$forall f <- files j $forall f <- files j
<textarea id=#{fst f}_textarea name=text rows=25 cols=80 style=display:none; disabled=disabled <textarea id=#{fst f}_textarea name=text rows=25 cols=80 style=display:none; disabled=disabled>
#{snd f} #{snd f}
<tr#addbuttonrow <tr#addbuttonrow>
<td <td>
<span.help>^{formathelp} <span.help>^{formathelp}
<td align=right <td align=right>
<span.help <span.help>
Are you sure ? This will overwrite the journal. # Are you sure ? This will overwrite the journal. #
<input type=hidden name=action value=edit <input type=hidden name=action value=edit>
<input type=submit name=submit value="save journal" <input type=submit name=submit value="save journal">
\ or # \ or #
<a href="#" onclick="return editformToggle(event)">cancel <a href="#" onclick="return editformToggle(event)">cancel
|] |]
@ -853,20 +853,20 @@ editform VD{..} = [hamlet|
-- | Import journal form. -- | Import journal form.
importform :: HtmlUrl AppRoute importform :: HtmlUrl AppRoute
importform = [hamlet| importform = [hamlet|
<form#importform method=POST style=display:none; <form#importform method=POST style=display:none;>
<table.form <table.form>
<tr <tr>
<td <td>
<input type=file name=file <input type=file name=file>
<input type=hidden name=action value=import <input type=hidden name=action value=import>
<input type=submit name=submit value="import from file" <input type=submit name=submit value="import from file">
\ or # \ or #
<a href="#" onclick="return importformToggle(event)" cancel <a href="#" onclick="return importformToggle(event)">cancel
|] |]
journalselect :: [(FilePath,String)] -> HtmlUrl AppRoute journalselect :: [(FilePath,String)] -> HtmlUrl AppRoute
journalselect journalfiles = [hamlet| journalselect journalfiles = [hamlet|
<select id=journalselect name=journal onchange="editformJournalSelect(event)" <select id=journalselect name=journal onchange="editformJournalSelect(event)">
$forall f <- journalfiles $forall f <- journalfiles
<option value=#{fst f}>#{fst f} <option value=#{fst f}>#{fst f}
|] |]