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('%s/css/main.css' % request.script_name)}
8 <link media="only screen and (max-device-width: 480px)" href="${request.script_name}/css/mobile.css" type="text/css" rel="stylesheet" />
9 <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable=no" />
10 <link rel="apple-touch-icon" href="${request.script_name}/icons/apple-touch.png" />
11 <link rel="apple-touch-startup-image" href="${request.script_name}/icons/apple-touch-startup.png" />
12 <meta name="apple-mobile-web-app-capable" content="yes" />
13 <meta name="apple-mobile-web-app-status-bar-style" content="black" />
14 ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')}
15 ${h.javascript_link('%s/js/mobile.js' % request.script_name)}
18 % for message in h.flash.pop_messages():
19 <div class="flash">${message | n}</div>
23 <a href="${h.url_for(request.url, use_non_mobile='yes')}">Use non mobile interface</a>
29 from datetime import date
32 <%def name="title()">BlueChips
38 <%def name="formatUser(user)">
39 % if user == request.environ['user']:
46 <%def name="tabs(selected)">
48 % for name in ('status', 'spend', 'transfer'):
55 <a id="${name}" class="${klass}" href="${h.url_for(controller=name, action='index')}">
56 <img src="${request.script_name}/icons/${name}.png" alt="">
57 <span>${name.capitalize()}</span>
63 <%def name="spendForm()">
64 <div id="tab-spend" class="tab">
71 <form action="${h.url_for(controller='spend', action='update', id=id)}" method="post">
72 ${h.auth_token_hidden_field()}
75 <th><label for="spender_id">Spender</label></th>
76 <td>${h.select('spender_id', [h.grab(c.expenditure, 'spender_id')], c.users)}</td>
79 <th><label for="amount">Amount</label></th>
80 <td>${h.currency('amount', h.grab(c.expenditure, 'amount'), size=8)}</td>
83 <th><label for="date">Date</label></th>
84 <td>${h.text('date', h.grab(c.expenditure, 'date').strftime('%m/%d/%Y'), size=16)}</td>
87 <th><label for="description">Description</label></th>
88 <td>${h.text('description', h.grab(c.expenditure, 'description'))}</td>
91 <th><label for="tags">Tags</label></th>
92 <td>${h.text('tags', h.grab(c, 'tags'))}</td>
96 <p>Change how an expenditure is split up.</p>
99 % for ii, user_row in enumerate(c.users):
101 user_id, user = user_row
104 <th><label for="shares-${ii}amount">${user.name}</label></th>
106 ${h.text('shares-%d.amount' % ii, 1 if user.resident else None)}
107 ${h.hidden('shares-%d.user_id' % ii, user.id)}
113 ${h.submit(None, 'Submit', class_="submitbutton")}
121 <%def name="transferForm()">
128 <div id="tab-transfer" class="tab">
129 <form action="${h.url_for(controller='transfer', action='update', id=id)}" method="post">
130 ${h.auth_token_hidden_field()}
133 <th><label for="debtor_id">From</label></th>
134 <td>${h.select('debtor_id', [h.grab(c.transfer, 'debtor_id')], c.users)}</td>
137 <th><label for="creditor_id">To</label></th>
138 <td>${h.select('creditor_id', [h.grab(c.transfer, 'creditor_id')], c.users)}</td>
141 <th><label for="amount">Amount</label></th>
142 <td>${h.currency('amount', h.grab(c.transfer, 'amount'), size=8)}</td>
145 <th><label for="date">Date</label></th>
146 <td>${h.text('date', h.grab(c.transfer, 'date').strftime('%m/%d/%Y'), size=16)}</td>
149 <th><label for="description">Description</label></th>
150 <td>${h.text('description', h.grab(c.transfer, 'description'))}</td>
154 <input type="submit" value="Submit" />