add customer views

This commit is contained in:
Lance Edgar 2012-08-10 14:18:34 -07:00
parent 96046d9089
commit 4949ec8818
4 changed files with 179 additions and 0 deletions

View file

@ -0,0 +1,7 @@
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<p>${h.link_to("Back to Customers", url('customers'))}</p>
</%def>
${parent.body()}

View file

@ -0,0 +1,5 @@
<%inherit file="/index.mako" />
<%def name="title()">Customers</%def>
${parent.body()}

View file

@ -0,0 +1,49 @@
<%inherit file="/customers/crud.mako" />
${parent.body()}
<h2>People</h2>
% if fieldset.model.people:
<p>Customer account is associated with the following people:</p>
<div class="grid hoverable">
<table>
<thead>
<th>First Name</th>
<th>Last Name</th>
</thead>
<tbody>
% for i, person in enumerate(fieldset.model.people, 1):
<tr class="${'odd' if i % 2 else 'even'}">
<td>${person.first_name or ''}</td>
<td>${person.last_name or ''}</td>
</tr>
% endfor
</tbody>
</table>
</div>
% else:
<p>Customer account is not associated with any people.</p>
% endif
<h2>Groups</h2>
% if fieldset.model.groups:
<p>Customer account belongs to the following groups:</p>
<div class="grid hoverable">
<table>
<thead>
<th>ID</th>
<th>Name</th>
</thead>
<tbody>
% for i, group in enumerate(fieldset.model.groups, 1):
<tr class="${'odd' if i % 2 else 'even'}">
<td>${group.id}</td>
<td>${group.name or ''}</td>
</tr>
% endfor
</tbody>
</table>
</div>
% else:
<p>Customer account doesn't belong to any groups.</p>
% endif