]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
Add navigation bar
[bluechips.git] / bluechips / templates / base.mako
index fc4398cf70a276bfd881848e08521051a54244f2..a9865c1f2ae8c277bcdc8d2f405b491d24bfbf11 100644 (file)
@@ -8,6 +8,26 @@
   </head>
   <body>
     <h1>${self.title()}</h1>
+    <% messages = h.flash.pop_messages() %>
+    % if messages:
+    <ul id="flash-messages">
+    % for message in messages:
+        <li>${message}</li>
+    % endfor
+    </ul>
+    % endif
+    <div id="nav">
+        <ul>
+            <li>${h.link_to('Dashboard', h.url_for(controller='status',
+                                                   action='index'))}</li>
+            <li>${h.link_to('Expense', h.url_for(controller='spend',
+                                                 action='index'))}</li>
+            <li>${h.link_to('Transfer', h.url_for(controller='transfer',
+                                                  action='index'))}</li>
+            <li>${h.link_to('History', h.url_for(controller='history',
+                                                 action='index'))}</li>
+        </ul>
+    </div>
     <div id="content">
       ${next.body()}
     </div>
 </html>
 
 <%def name="title()">BlueChips</%def>
+
+<%def name="listExpenditures(es)">
+<table>
+    <tr>
+        <th>Date</th>
+        <th>Spender</th>
+        <th>Description</th>
+        <th>Amount</th>
+    </tr>
+    % for e in es:
+    <tr>
+        <td>${e.date}</td>
+        <td>${e.spender.name}</td>
+        <td>${e.description}</td>
+        <td>$${h.round_currency(e.amount)}</td>
+    </tr>
+    % endfor
+</table>
+</%def>
+
+<%def name="listTransfers(ts)">
+<table>
+    <tr>
+        <th>Date</th>
+        <th>From</th>
+        <th>To</th>
+        <th>Description</th>
+        <th>Amount</th>
+    </tr>
+    % for t in ts:
+    <tr>
+        <td>${t.date}</td>
+        <td>${t.debtor.name}</td>
+        <td>${t.creditor.name}</td>
+        <td>${t.description}</td>
+        <td>$${h.round_currency(t.amount)}</td>
+    </tr>
+    % endfor
+</table>
+</%def>