diff --git a/rattail/pyramid/templates/customers/crud.mako b/rattail/pyramid/templates/customers/crud.mako new file mode 100644 index 00000000..c8393e94 --- /dev/null +++ b/rattail/pyramid/templates/customers/crud.mako @@ -0,0 +1,7 @@ +<%inherit file="/crud.mako" /> + +<%def name="context_menu_items()"> +
${h.link_to("Back to Customers", url('customers'))}
+%def> + +${parent.body()} diff --git a/rattail/pyramid/templates/customers/index.mako b/rattail/pyramid/templates/customers/index.mako new file mode 100644 index 00000000..a73d411c --- /dev/null +++ b/rattail/pyramid/templates/customers/index.mako @@ -0,0 +1,5 @@ +<%inherit file="/index.mako" /> + +<%def name="title()">Customers%def> + +${parent.body()} diff --git a/rattail/pyramid/templates/customers/read.mako b/rattail/pyramid/templates/customers/read.mako new file mode 100644 index 00000000..261765a3 --- /dev/null +++ b/rattail/pyramid/templates/customers/read.mako @@ -0,0 +1,49 @@ +<%inherit file="/customers/crud.mako" /> + +${parent.body()} + +Customer account is associated with the following people:
+First Name | +Last Name | + + + % for i, person in enumerate(fieldset.model.people, 1): +
---|---|
${person.first_name or ''} | +${person.last_name or ''} | +
Customer account is not associated with any people.
+% endif + +Customer account belongs to the following groups:
+ID | +Name | + + + % for i, group in enumerate(fieldset.model.groups, 1): +
---|---|
${group.id} | +${group.name or ''} | +
Customer account doesn't belong to any groups.
+% endif diff --git a/rattail/pyramid/views/customers.py b/rattail/pyramid/views/customers.py new file mode 100644 index 00000000..c3365790 --- /dev/null +++ b/rattail/pyramid/views/customers.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2012 Lance Edgar +# +# This file is part of Rattail. +# +# Rattail is free software: you can redistribute it and/or modify it under the +# terms of the GNU Affero General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for +# more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Rattail. If not, see