1 <%inherit file="/mobile/base.mako"/>
4 from datetime import date
8 <a id="status" class="selected" href="#">
9 <img src="/icons/dashboard.png" alt="">
10 <span>Dashboard</span>
12 <a id="spend" href="#">
13 <img src="/icons/spend.png" alt="">
16 <a id="transfer" href="#">
17 <img src="/icons/transfer.png" alt="">
22 <div id="tab-status" class="tab">
23 % for message in h.flash.pop_messages():
24 <div class="flash">${message | n}</div>
27 % if len(c.settle) == 0:
28 <p>No need! The books are balanced!</p>
30 <p>To balance the books, the following transfers need to be made:</p>
38 % for transfer in c.settle:
40 <td>${transfer[0].name}</td>
41 <td>${transfer[1].name}</td>
42 <td>${transfer[2]}</td>
49 <div id="tab-spend" class="tab">
50 <form action="${h.url_for(controller='spend', action='update')}" method="post">
51 ${h.auth_token_hidden_field()}
54 <th><label for="spender_id">Spender</label></th>
55 <td>${h.select('spender_id', [request.environ['user'].id], c.users)}</td>
58 <th><label for="amount">Amount</label></th>
59 <td>${h.currency('amount', 0, size=8)}</td>
62 <th><label for="date">Date</label></th>
63 <td>${h.text('date', date.today().strftime('%m/%d/%Y'), size=16)}</td>
66 <th><label for="description">Description</label></th>
67 <td>${h.text('description')}</td>
71 <p>Change how an expenditure is split up.</p>
74 % for ii, user_row in enumerate(c.users):
76 user_id, user = user_row
83 <th><label for="shares-${ii}amount">${user.name}</label></th>
85 ${h.text('shares-%d.amount' % ii, percent)}
86 ${h.hidden('shares-%d.user_id' % ii, user.id)}
92 ${h.submit(None, 'Submit', class_="submitbutton")}
99 <div id="tab-transfer" class="tab">
100 <form action="${h.url_for(controller='transfer', action='update')}" method="post">
101 ${h.auth_token_hidden_field()}
104 <th><label for="debtor_id">From</label></th>
105 <td>${h.select('debtor_id', request.environ['user'].id, c.users)}</td>
108 <th><label for="creditor_id">To</label></th>
109 <td>${h.select('creditor_id', None, c.users)}</td>
112 <th><label for="amount">Amount</label></th>
113 <td>${h.currency('amount', 0, size=8)}</td>
116 <th><label for="date">Date</label></th>
117 <td>${h.text('date', date.today().strftime('%m/%d/%Y'), size=16)}</td>
120 <th><label for="description">Description</label></th>
121 <td>${h.text('description')}</td>
125 <input type="submit" value="Submit" />