add customer views
This commit is contained in:
parent
96046d9089
commit
4949ec8818
4 changed files with 179 additions and 0 deletions
7
rattail/pyramid/templates/customers/crud.mako
Normal file
7
rattail/pyramid/templates/customers/crud.mako
Normal 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()}
|
5
rattail/pyramid/templates/customers/index.mako
Normal file
5
rattail/pyramid/templates/customers/index.mako
Normal file
|
@ -0,0 +1,5 @@
|
|||
<%inherit file="/index.mako" />
|
||||
|
||||
<%def name="title()">Customers</%def>
|
||||
|
||||
${parent.body()}
|
49
rattail/pyramid/templates/customers/read.mako
Normal file
49
rattail/pyramid/templates/customers/read.mako
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue