${h.stylesheet_link('/css/main.css')}
</head>
<body>
- <% messages = h.flash.pop_messages() %>
- % if messages:
- <ul id="flash-messages">
- % for message in messages:
- <li>${message}</li>
- % endfor
- </ul>
- % endif
<div id="nav" class="block">
<table>
<tr>
</tr>
</table>
</div>
+ % for message in h.flash.pop_messages():
+ <div class="flash">${message | n}</div>
+ % endfor
<div id="content">
${next.body()}
</div>
</%def>
<%def name="formatUser(user)">
- % if user == c.user:
+ % if user == request.environ['user']:
<strong>Me</strong>
% else:
${user.name}
<th class="user">Spender</th>
<th class="description">Description</th>
<th class="amount">Amount</th>
+ <th class="share">My Share</th>
<th class="editlink"></th>
</tr>
% for e in es:
<%
- if e.involves(c.user):
+ if e.involves(request.environ['user']):
klass = 'user-involved'
else:
klass = 'user-not-involved'
<td class="user">${formatUser(e.spender)}</td>
<td class="description">${e.description}</td>
<td class="amount">${e.amount}</td>
+ <td class="share">${e.share(request.environ['user'])}</td>
<td class="editlink">${h.link_to('Edit', h.url_for(controller='spend', action='edit', id=e.id))}</td>
</tr>
% endfor
</tr>
% for t in ts:
<%
- if t.involves(c.user):
+ if t.involves(request.environ['user']):
klass = 'user-involved'
else:
klass = 'user-not-involved'