Convert (most?) basic views to use master view pattern.

This commit is contained in:
Lance Edgar 2015-12-07 15:08:14 -06:00
parent ab40685175
commit 16bbbb4a75
35 changed files with 363 additions and 1187 deletions

View file

@ -1,13 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Customers", url('customers'))}</li>
% if form.readonly and request.has_perm('customers.update'):
<li>${h.link_to("Edit this Customer", url('customer.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Customer", url('customer.read', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,6 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Customers</%def>
${parent.body()}

View file

@ -1,12 +1,10 @@
## -*- coding: utf-8 -*-
<%inherit file="/customers/crud.mako" />
<%inherit file="/master/view.mako" />
${parent.body()}
<% customer = form.fieldset.model %>
<h2>People</h2>
% if customer.people:
% if instance.people:
<p>Customer account is associated with the following people:</p>
<div class="grid clickable">
<table>
@ -15,8 +13,8 @@ ${parent.body()}
<th>Last Name</th>
</thead>
<tbody>
% for i, person in enumerate(customer.people, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('person.read', uuid=person.uuid)}">
% for i, person in enumerate(instance.people, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('people.view', uuid=person.uuid)}">
<td>${person.first_name or ''}</td>
<td>${person.last_name or ''}</td>
</tr>
@ -29,7 +27,7 @@ ${parent.body()}
% endif
<h2>Groups</h2>
% if customer.groups:
% if instance.groups:
<p>Customer account belongs to the following groups:</p>
<div class="grid clickable">
<table>
@ -38,8 +36,8 @@ ${parent.body()}
<th>Name</th>
</thead>
<tbody>
% for i, group in enumerate(customer.groups, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('customer_group.read', uuid=group.uuid)}">
% for i, group in enumerate(instance.groups, 1):
<tr class="${'odd' if i % 2 else 'even'}" url="${url('customergroups.view', uuid=group.uuid)}">
<td>${group.id}</td>
<td>${group.name or ''}</td>
</tr>