X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Ftemplates%2Fspend%2Findex.mako;h=d4064cb58e914a3808e6daf92aa5d33de85cf32c;hb=HEAD;hp=61047ad445ab1e243278c40840c42e5f4ad365b9;hpb=abe8940869b545ae8c517511d4e9cf63b8dafd89;p=bluechips.git diff --git a/bluechips/templates/spend/index.mako b/bluechips/templates/spend/index.mako index 61047ad..d4064cb 100644 --- a/bluechips/templates/spend/index.mako +++ b/bluechips/templates/spend/index.mako @@ -1,8 +1,58 @@ <%inherit file="/base.mako"/> -<%def name="title()">${parent.title()} :: Add a New Expenditure -<%! -import bluechips.widgets.spend as forms -%> +
+ ${h.auth_token_hidden_field()} + + + + + + + + + + + + + + + + + + + + + +
${h.select('spender_id', c.expenditure.spender_id, c.users)}
${h.currency('amount', c.expenditure.amount, size=8, onkeyup="calcSplit();")}
${h.text('date', c.expenditure.date.strftime('%m/%d/%Y'), size=16, class_='datepicker')}
${h.text('description', c.expenditure.description, size=64)}
${h.text('tags', c.tags, size=64)}
-${forms.new_spend_form(c.expenditure, action=h.url_for(action='new'))} +

Change how an expenditure is split up. Enter a percentage, or something like a percentage, for each user. They don't have to add to 100.

+ + + % for ii, user_row in enumerate(c.users): + <% + user_id, user = user_row + percent = c.values['shares-%d.amount' % ii] + %> + + + + + + % endfor + + + + +
+ ${h.text('shares-%d.amount' % ii, percent, class_="share-text", onkeyup="calcSplit();")} + ${h.hidden('shares-%d.user_id' % ii, user.id)} + + 0.00 +
+ ${h.submit(None, 'Submit', class_="submitbutton")} + %if c.expenditure.id: + + %endif +
+
+${h.javascript_link('%s/js/calculator.js' % request.script_name)}