--- /dev/null
+"""
+Display old transactions
+"""
+
+import logging
+
+from bluechips.lib.base import *
+from bluechips.lib.totals import *
+
+import sqlalchemy
+
+log = logging.getLogger(__name__)
+
+class HistoryController(BaseController):
+ def index(self):
+ c.expenditures = meta.Session.query(model.Expenditure).all()
+ c.transfers = meta.Session.query(model.Transfer).all()
+
+ return render('/history/index.mako')
</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>
--- /dev/null
+<%inherit file="/base.mako"/>
+
+<%def name="title()">${parent.title()} :: History</%def>
+
+<h2>Group Expenditures</h2>
+
+${self.listExpenditures(c.expenditures)}
+
+<h2>Transfers</h2>
+
+${self.listTransfers(c.transfers)}
--- /dev/null
+from bluechips.tests import *
+
+class TestHistoryController(TestController):
+
+ def test_index(self):
+ response = self.app.get(url_for(controller='history'))
+ # Test response...