]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
Fix indentation on base template
[bluechips.git] / bluechips / templates / base.mako
index 5d4bda53b31f5351ae16683d68366b4bbb0dc40a..8403b016f956db65c7c0039e000b4fbdb08fa640 100644 (file)
     % endfor
     </ul>
     % endif
+    <div id="nav">
+      <ul>
+        <li>${h.link_to('Dashboard', h.url_for(controller='status',
+                                               action='index',
+                                               id=None))}</li>
+        <li>${h.link_to('Expense', h.url_for(controller='spend',
+                                             action='index',
+                                             id=None))}</li>
+        <li>${h.link_to('Transfer', h.url_for(controller='transfer',
+                                              action='index',
+                                              id=None))}</li>
+        <li>${h.link_to('History', h.url_for(controller='history',
+                                             action='index',
+                                             id=None))}</li>
+      </ul>
+    </div>
     <div id="content">
       ${next.body()}
     </div>
   </body>
 </html>
 
-<%def name="title()">BlueChips</%def>
+<%def name="title()">BlueChips
+% if c.title != '':
+  :: ${c.title}
+% endif
+</%def>
+
+<%def name="listExpenditures(es)">
+<table>
+    <tr>
+        <th>Date</th>
+        <th>Spender</th>
+        <th>Description</th>
+        <th>Amount</th>
+        <th></th>
+    </tr>
+    % for e in es:
+    <tr>
+        <td>${e.date}</td>
+        <td>${e.spender.name}</td>
+        <td>${e.description}</td>
+        <td>${e.amount}</td>
+        <td>${h.link_to('Edit', h.url_for(controller='spend', 
+                                          action='edit',
+                                          id=e.id))}</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>
+        <th></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>${t.amount}</td>
+        <td>${h.link_to('Edit', h.url_for(controller='transfer', 
+                                          action='edit',
+                                          id=t.id))}</td>
+    </tr>
+    % endfor
+</table>
+</%def>