From 1d2e4f3e0f545547c37833445927569e5554fc2f Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Wed, 16 Jul 2008 07:04:56 +0000 Subject: [PATCH] And output the outstanding debts on the home page --- bluechips/controllers/status.py | 6 +++++- bluechips/templates/status/index.mako | 31 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 bluechips/templates/status/index.mako diff --git a/bluechips/controllers/status.py b/bluechips/controllers/status.py index 491493e..fa08448 100644 --- a/bluechips/controllers/status.py +++ b/bluechips/controllers/status.py @@ -5,9 +5,13 @@ Calculate the current state of the books import logging from bluechips.lib.base import * +from bluechips.lib.totals import * log = logging.getLogger(__name__) class StatusController(BaseController): def index(self): - return 'Hello World' + c.debts = debts() + c.settle = settle(c.debts) + + return render('/status/index.mako') diff --git a/bluechips/templates/status/index.mako b/bluechips/templates/status/index.mako new file mode 100644 index 0000000..777d09f --- /dev/null +++ b/bluechips/templates/status/index.mako @@ -0,0 +1,31 @@ +<%inherit file="/base.mako"/> + +

Settling Transfers

+ +% if len(c.settle) == 0: +

No need! The books are balanced!

+% else: +

To balance the books, the following transfers need to be made:

+ + + + + + + + % for transfer in c.settle: + + + + + + % endfor +
FromToAmount
${transfer[0].username}${transfer[1].username}$${h.round_currency(transfer[2])}
+% endif + +

Add a new transaction

+ + -- 2.45.2