]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/templates/spend/index.mako
Expenditures require a description
[bluechips.git] / bluechips / templates / spend / index.mako
1 <%inherit file="/base.mako"/>
2
3 <form action="${h.url_for(controller='spend', action='update', id=c.expenditure.id)}" method="post">
4   ${h.auth_token_hidden_field()}
5   <table class="form">
6     <tr>
7       <th><label for="spender_id">Spender</label></th>
8       <td>${h.select('spender_id', c.expenditure.spender_id, c.users)}</td>
9     </tr>
10     <tr>
11       <th><label for="amount">Amount</label></th>
12       <td>${h.currency('amount', c.expenditure.amount, size=8)}</td>
13     </tr>
14     <tr>
15       <th><label for="date">Date</label></th>
16       <td>${h.text('date', c.expenditure.date.strftime('%m/%d/%Y'), size=16, class_='datepicker')}</td>
17     </tr>
18     <tr>
19       <th><label for="description">Description</label></th>
20       <td>${h.text('description', c.expenditure.description, size=64)}</td>
21     </tr>
22   </table>
23
24   <p>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.</p>
25
26   <table class="form">
27     % for ii, user_row in enumerate(c.users):
28       <%
29         user_id, user = user_row
30         percent = c.values['shares-%d.amount' % ii]
31       %>
32       <tr>
33         <th><label for="shares-${ii}amount">${user.name}</label></th>
34         <td>
35           ${h.text('shares-%d.amount' % ii, percent)}
36           ${h.hidden('shares-%d.user_id' % ii, user.id)}
37         </td>
38       </tr>
39     % endfor
40     <tr>
41       <td colspan="2">
42         ${h.submit(None, 'Submit', class_="submitbutton")}
43       </td>
44     </tr>
45   </table>
46 </form>