]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
Move common title generating code into base template
[bluechips.git] / bluechips / templates / base.mako
index a9865c1f2ae8c277bcdc8d2f405b491d24bfbf11..66a7cb9c130bebc1f22aa07e0e455af4c0995d6b 100644 (file)
     <div id="nav">
         <ul>
             <li>${h.link_to('Dashboard', h.url_for(controller='status',
-                                                   action='index'))}</li>
+                                                   action='index',
+                                                   id=None))}</li>
             <li>${h.link_to('Expense', h.url_for(controller='spend',
-                                                 action='index'))}</li>
+                                                 action='index',
+                                                 id=None))}</li>
             <li>${h.link_to('Transfer', h.url_for(controller='transfer',
-                                                  action='index'))}</li>
+                                                  action='index',
+                                                  id=None))}</li>
             <li>${h.link_to('History', h.url_for(controller='history',
-                                                 action='index'))}</li>
+                                                 action='index',
+                                                 id=None))}</li>
         </ul>
     </div>
     <div id="content">
   </body>
 </html>
 
-<%def name="title()">BlueChips</%def>
+<%def name="title()">BlueChips
+% if c.title != '':
+  :: ${c.title}
+% endif
+</%def>
 
 <%def name="listExpenditures(es)">
 <table>
         <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>$${h.round_currency(e.amount)}</td>
+        <td>${e.amount}</td>
+        <td>${h.link_to('Edit', h.url_for(controller='spend', 
+                                          action='edit',
+                                          id=e.id))}</td>
     </tr>
     % endfor
 </table>
@@ -63,6 +75,7 @@
         <th>To</th>
         <th>Description</th>
         <th>Amount</th>
+        <th></th>
     </tr>
     % for t in ts:
     <tr>
         <td>${t.debtor.name}</td>
         <td>${t.creditor.name}</td>
         <td>${t.description}</td>
-        <td>$${h.round_currency(t.amount)}</td>
+        <td>${t.amount}</td>
+        <td>${h.link_to('Edit', h.url_for(controller='transfer', 
+                                          action='edit',
+                                          id=t.id))}</td>
     </tr>
     % endfor
 </table>