$def with (earmarks, limit)
$var width: 90%
$var color: white
$var title: Earmarks
<style>
.header { background-color: #fff; font-weight: bold; border-bottom: 1px solid #999; border-top: 1px solid #999; }
</style>
<h1>Earmarks
$if getattr(earmarks[0], 'sponsor_name', None): requested by $earmarks[0].sponsor_name
</h1>
<p class='subheading'>Data from Fiscal Year 2008 appropriations bills supplied by Taxpayers for Common Sense. </p>
<table class="structure" width="100%">
<tr><td class="header">Amount</td><td class="header" colspan="2">Earmark Description</td><td class="header" style="white-space: nowrap">Intended Recipient</td></tr>
$ trclass = "odd"
$for em in earmarks:
$if trclass == "odd":
$ trclass = "even"
$else:
$ trclass = "odd"
<tr class="$trclass">
<td style="padding: 3px; text-align: right;"><a href="/e/$em.id"><b>\$$commify(em.final_amt)</b></a></td>
<td style="color: #999; padding-left: 6px; padding-right: 8px;">for</td>
<td> $em.description </td>
<td>$em.intended_recipient</td>
</tr>
</table>
$ page = int(query_param("page", 0))
$if page != 0:
<<<a href="$changequery(page=page - 1)">Prev</a>
$if len(earmarks) == limit:
| <a href="$changequery(page=page + 1)">Next</a> >>
<!--
<p><strong>Developers:</strong> Get this page in <a href="index.n3?page=$page">N3</a>, <a href="index.xml?page=$page">XML</a>, or <a href="index.json?page=$page">JSON</a>.</p>
-->