1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <title>${self.title()}</title>
7 ${h.stylesheet_link('/css/main.css')}
8 <link media="only screen and (max-device-width: 480px)" href="/css/mobile.css" type="text/css" rel="stylesheet">
9 <meta name="viewport" content="width = device-width, user-scalable=no">
10 <link rel="apple-touch-icon" href="/icons/apple-touch.png">
13 % for message in h.flash.pop_messages():
14 <div class="flash">${message | n}</div>
17 ${h.javascript_link('/js/jquery-1.3.2.js')}
18 ${h.javascript_link('/js/mobile.js')}
23 from datetime import date
26 <%def name="title()">BlueChips
32 <%def name="formatUser(user)">
33 % if user == request.environ['user']:
40 <%def name="tabs(selected)">
42 % for name in ('status', 'spend', 'transfer'):
49 <a id="${name}" class="${klass}" href="${h.url_for(controller=name, action='index', id=None)}">
50 <img src="/icons/${name}.png" alt="">
51 <span>${name.capitalize()}</span>
57 <%def name="spendForm()">
58 <div id="tab-spend" class="tab">
65 <form action="${h.url_for(controller='spend', action='update', id=id)}" method="post">
66 ${h.auth_token_hidden_field()}
69 <th><label for="spender_id">Spender</label></th>
70 <td>${h.select('spender_id', [h.grab(c.expenditure, 'spender_id')], c.users)}</td>
73 <th><label for="amount">Amount</label></th>
74 <td>${h.currency('amount', h.grab(c.expenditure, 'amount'), size=8)}</td>
77 <th><label for="date">Date</label></th>
78 <td>${h.text('date', h.grab(c.expenditure, 'date').strftime('%m/%d/%Y'), size=16)}</td>
81 <th><label for="description">Description</label></th>
82 <td>${h.text('description', h.grab(c.expenditure, 'description'))}</td>
86 <p>Change how an expenditure is split up.</p>
89 % for ii, user_row in enumerate(c.users):
91 user_id, user = user_row
98 <th><label for="shares-${ii}amount">${user.name}</label></th>
100 ${h.text('shares-%d.amount' % ii, percent)}
101 ${h.hidden('shares-%d.user_id' % ii, user.id)}
107 ${h.submit(None, 'Submit', class_="submitbutton")}
115 <%def name="transferForm()">
122 <div id="tab-transfer" class="tab">
123 <form action="${h.url_for(controller='transfer', action='update', id=id)}" method="post">
124 ${h.auth_token_hidden_field()}
127 <th><label for="debtor_id">From</label></th>
128 <td>${h.select('debtor_id', [h.grab(c.transfer, 'debtor_id')], c.users)}</td>
131 <th><label for="creditor_id">To</label></th>
132 <td>${h.select('creditor_id', [h.grab(c.transfer, 'creditor_id')], c.users)}</td>
135 <th><label for="amount">Amount</label></th>
136 <td>${h.currency('amount', h.grab(c.transfer, 'amount'), size=8)}</td>
139 <th><label for="date">Date</label></th>
140 <td>${h.text('date', h.grab(c.transfer, 'date').strftime('%m/%d/%Y'), size=16)}</td>
143 <th><label for="description">Description</label></th>
144 <td>${h.text('description', h.grab(c.transfer, 'description'))}</td>
148 <input type="submit" value="Submit" />