]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/templates/base.mako
Add navigation bar
[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="nav">
20         <ul>
21             <li>${h.link_to('Dashboard', h.url_for(controller='status',
22                                                    action='index'))}</li>
23             <li>${h.link_to('Expense', h.url_for(controller='spend',
24                                                  action='index'))}</li>
25             <li>${h.link_to('Transfer', h.url_for(controller='transfer',
26                                                   action='index'))}</li>
27             <li>${h.link_to('History', h.url_for(controller='history',
28                                                  action='index'))}</li>
29         </ul>
30     </div>
31     <div id="content">
32       ${next.body()}
33     </div>
34   </body>
35 </html>
36
37 <%def name="title()">BlueChips</%def>
38
39 <%def name="listExpenditures(es)">
40 <table>
41     <tr>
42         <th>Date</th>
43         <th>Spender</th>
44         <th>Description</th>
45         <th>Amount</th>
46     </tr>
47     % for e in es:
48     <tr>
49         <td>${e.date}</td>
50         <td>${e.spender.name}</td>
51         <td>${e.description}</td>
52         <td>$${h.round_currency(e.amount)}</td>
53     </tr>
54     % endfor
55 </table>
56 </%def>
57
58 <%def name="listTransfers(ts)">
59 <table>
60     <tr>
61         <th>Date</th>
62         <th>From</th>
63         <th>To</th>
64         <th>Description</th>
65         <th>Amount</th>
66     </tr>
67     % for t in ts:
68     <tr>
69         <td>${t.date}</td>
70         <td>${t.debtor.name}</td>
71         <td>${t.creditor.name}</td>
72         <td>${t.description}</td>
73         <td>$${h.round_currency(t.amount)}</td>
74     </tr>
75     % endfor
76 </table>
77 </%def>