]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/templates/base.mako
Add history controller to display old transactions
[bluechips.git] / bluechips / templates / base.mako
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4   <head>
5     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6     <title>${self.title()}</title>
7     ${h.stylesheet_link('/css/main.css')}
8   </head>
9   <body>
10     <h1>${self.title()}</h1>
11     <% messages = h.flash.pop_messages() %>
12     % if messages:
13     <ul id="flash-messages">
14     % for message in messages:
15         <li>${message}</li>
16     % endfor
17     </ul>
18     % endif
19     <div id="content">
20       ${next.body()}
21     </div>
22   </body>
23 </html>
24
25 <%def name="title()">BlueChips</%def>
26
27 <%def name="listExpenditures(es)">
28 <table>
29     <tr>
30         <th>Date</th>
31         <th>Spender</th>
32         <th>Description</th>
33         <th>Amount</th>
34     </tr>
35     % for e in es:
36     <tr>
37         <td>${e.date}</td>
38         <td>${e.spender.name}</td>
39         <td>${e.description}</td>
40         <td>$${h.round_currency(e.amount)}</td>
41     </tr>
42     % endfor
43 </table>
44 </%def>
45
46 <%def name="listTransfers(ts)">
47 <table>
48     <tr>
49         <th>Date</th>
50         <th>From</th>
51         <th>To</th>
52         <th>Description</th>
53         <th>Amount</th>
54     </tr>
55     % for t in ts:
56     <tr>
57         <td>${t.date}</td>
58         <td>${t.debtor.name}</td>
59         <td>${t.creditor.name}</td>
60         <td>${t.description}</td>
61         <td>$${h.round_currency(t.amount)}</td>
62     </tr>
63     % endfor
64 </table>
65 </%def>