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,16 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Brands", url('brands'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Brand", url('brand.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Brand", url('brand.read', uuid=form.fieldset.model.uuid))}</li>
% endif
% if version_count is not Undefined and request.has_perm('brand.versions.view'):
<li>${h.link_to("View Change History ({0})".format(version_count), url('brand.versions', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Brands</%def>
<%def name="context_menu_items()">
% if request.has_perm('brands.create'):
<li>${h.link_to("Create a new Brand", url('brand.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,16 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Categories", url('categories'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Category", url('category.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Category", url('category.read', uuid=form.fieldset.model.uuid))}</li>
% endif
% if version_count is not Undefined and request.has_perm('category.versions.view'):
<li>${h.link_to("View Change History ({0})".format(version_count), url('category.versions', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Categories</%def>
<%def name="context_menu_items()">
% if request.has_perm('categories.create'):
<li>${h.link_to("Create a new Category", url('category.create'))}</li>
% endif
</%def>
${parent.body()}

View file

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

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Customer Groups</%def>
<%def name="context_menu_items()">
% if request.has_perm('customer_groups.create'):
<li>${h.link_to("Create a new Customer Group", url('customer_group.create'))}</li>
% endif
</%def>
${parent.body()}

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>

View file

@ -1,16 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Departments", url('departments'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Department", url('department.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Department", url('department.read', uuid=form.fieldset.model.uuid))}</li>
% endif
% if version_count is not Undefined and request.has_perm('department.versions.view'):
<li>${h.link_to("View Change History ({0})".format(version_count), url('department.versions', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Departments</%def>
<%def name="context_menu_items()">
% if request.has_perm('departments.create'):
<li>${h.link_to("Create a new Department", url('department.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,13 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Employees", url('employees'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Employee", url('employee.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Employee", url('employee.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()">Employees</%def>
${parent.body()}

View file

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

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Families</%def>
<%def name="context_menu_items()">
% if request.has_perm('families.create'):
<li>${h.link_to("Create a new Family", url('family.create'))}</li>
% endif
</%def>
${parent.body()}

View file

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

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Report Codes</%def>
<%def name="context_menu_items()">
% if request.has_perm('reportcodes.create'):
<li>${h.link_to("Create a new Report Code", url('reportcode.create'))}</li>
% endif
</%def>
${parent.body()}

View file

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

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Stores</%def>
<%def name="context_menu_items()">
% if request.has_perm('stores.create'):
<li>${h.link_to("Create a new Store", url('store.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,16 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Subdepartments", url('subdepartments'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Subdepartment", url('subdepartment.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Subdepartment", url('subdepartment.read', uuid=form.fieldset.model.uuid))}</li>
% endif
% if version_count is not Undefined and request.has_perm('subdepartment.versions.view'):
<li>${h.link_to("View Change History ({0})".format(version_count), url('subdepartment.versions', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Subdepartments</%def>
<%def name="context_menu_items()">
% if request.has_perm('subdepartments.create'):
<li>${h.link_to("Create a new Subdepartment", url('subdepartment.create'))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,16 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/crud.mako" />
<%def name="context_menu_items()">
<li>${h.link_to("Back to Vendors", url('vendors'))}</li>
% if form.readonly:
<li>${h.link_to("Edit this Vendor", url('vendor.update', uuid=form.fieldset.model.uuid))}</li>
% elif form.updating:
<li>${h.link_to("View this Vendor", url('vendor.read', uuid=form.fieldset.model.uuid))}</li>
% endif
% if version_count is not Undefined and request.has_perm('vendor.versions.view'):
<li>${h.link_to("View Change History ({0})".format(version_count), url('vendor.versions', uuid=form.fieldset.model.uuid))}</li>
% endif
</%def>
${parent.body()}

View file

@ -1,12 +0,0 @@
## -*- coding: utf-8 -*-
<%inherit file="/grid.mako" />
<%def name="title()">Vendors</%def>
<%def name="context_menu_items()">
% if request.has_perm('vendors.create'):
<li>${h.link_to("Create a new Vendor", url('vendor.create'))}</li>
% endif
</%def>
${parent.body()}