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