diff --git a/rattail/pyramid/templates/employees/base.mako b/rattail/pyramid/templates/employees/base.mako new file mode 100644 index 00000000..27f7dd90 --- /dev/null +++ b/rattail/pyramid/templates/employees/base.mako @@ -0,0 +1,2 @@ +<%inherit file="/base.mako" /> +${parent.body()} diff --git a/rattail/pyramid/templates/employees/crud.mako b/rattail/pyramid/templates/employees/crud.mako new file mode 100644 index 00000000..71b2e0b4 --- /dev/null +++ b/rattail/pyramid/templates/employees/crud.mako @@ -0,0 +1,8 @@ +<%inherit file="/employees/base.mako" /> +<%inherit file="/crud.mako" /> + +<%def name="menu()"> +
${h.link_to("Back to Employees", url('employees.list'))}
+%def> + +${parent.body()} diff --git a/rattail/pyramid/templates/employees/edit.mako b/rattail/pyramid/templates/employees/edit.mako new file mode 100644 index 00000000..47d8b103 --- /dev/null +++ b/rattail/pyramid/templates/employees/edit.mako @@ -0,0 +1,2 @@ +<%inherit file="/employees/crud.mako" /> +${parent.body()} diff --git a/rattail/pyramid/templates/employees/index.mako b/rattail/pyramid/templates/employees/index.mako new file mode 100644 index 00000000..9595775f --- /dev/null +++ b/rattail/pyramid/templates/employees/index.mako @@ -0,0 +1,12 @@ +<%inherit file="/employees/base.mako" /> +<%inherit file="/index.mako" /> + +<%def name="title()">Employees%def> + +<%def name="menu()"> + % if request.has_perm('employees.create'): +${h.link_to("Create a new Employee", url('employees.new'))}
+ % endif +%def> + +${parent.body()} diff --git a/rattail/pyramid/templates/employees/new.mako b/rattail/pyramid/templates/employees/new.mako new file mode 100644 index 00000000..47d8b103 --- /dev/null +++ b/rattail/pyramid/templates/employees/new.mako @@ -0,0 +1,2 @@ +<%inherit file="/employees/crud.mako" /> +${parent.body()} diff --git a/rattail/pyramid/views/__init__.py b/rattail/pyramid/views/__init__.py index 1b36d5cb..dcdd7996 100644 --- a/rattail/pyramid/views/__init__.py +++ b/rattail/pyramid/views/__init__.py @@ -32,3 +32,4 @@ def includeme(config): config.include('rattail.pyramid.views.departments') config.include('rattail.pyramid.views.categories') config.include('rattail.pyramid.views.products') + config.include('rattail.pyramid.views.employees') diff --git a/rattail/pyramid/views/employees.py b/rattail/pyramid/views/employees.py new file mode 100644 index 00000000..cf967b30 --- /dev/null +++ b/rattail/pyramid/views/employees.py @@ -0,0 +1,108 @@ +#!/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