X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Ftemplates%2Fspend%2Findex.mako;h=ff388a3eecace604ab6cb86bd8cb13efb9245091;hb=9cc05ca9160a9432d037afb9cc22c511e2542947;hp=dc2f606070dd8a4cd8164164092674fd23ab16d7;hpb=c419902fc831dc8077c74a8e8a88da081dbe4cf0;p=bluechips.git diff --git a/bluechips/templates/spend/index.mako b/bluechips/templates/spend/index.mako index dc2f606..ff388a3 100644 --- a/bluechips/templates/spend/index.mako +++ b/bluechips/templates/spend/index.mako @@ -5,6 +5,7 @@ %>
+ ${h.auth_token_hidden_field()} @@ -30,19 +31,10 @@ % for ii, user_row in enumerate(c.users): <% user_id, user = user_row - try: - percent = c.values['shares-%d.amount' % ii] - except TypeError: - try: - share = [s.share for s in c.expenditure.splits if s.user == user][0] - percent = (Decimal(100) * Decimal(int(share)) / Decimal(int(c.expenditure.amount))).quantize(Decimal("0.001")) - except IndexError: - percent = 0 + percent = c.values['shares-%d.amount' % ii] %> - +
- - ${h.text('shares-%d.amount' % ii, percent)} ${h.hidden('shares-%d.user_id' % ii, user.id)}