2019-08-16 15:46:01 -05:00
|
|
|
# -*- coding: utf-8; -*-
|
2019-08-17 01:19:35 -05:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Rattail -- Retail Software Framework
|
2024-07-01 13:25:31 -05:00
|
|
|
# Copyright © 2010-2024 Lance Edgar
|
2019-08-17 01:19:35 -05:00
|
|
|
#
|
|
|
|
# This file is part of Rattail.
|
|
|
|
#
|
|
|
|
# Rattail is free software: you can redistribute it and/or modify it under the
|
|
|
|
# terms of the GNU 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 General Public License for more
|
|
|
|
# details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along with
|
|
|
|
# Rattail. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
################################################################################
|
2019-08-16 15:46:01 -05:00
|
|
|
"""
|
|
|
|
Web Menus
|
|
|
|
"""
|
|
|
|
|
2024-07-01 13:25:31 -05:00
|
|
|
from tailbone import menus as base
|
2019-08-16 15:46:01 -05:00
|
|
|
|
|
|
|
|
2024-07-01 13:25:31 -05:00
|
|
|
class TutorialMenuHandler(base.MenuHandler):
|
|
|
|
"""
|
|
|
|
Demo menu handler
|
|
|
|
"""
|
|
|
|
|
|
|
|
def make_menus(self, request, **kwargs):
|
|
|
|
|
|
|
|
products_menu = self.make_products_menu(request)
|
|
|
|
|
|
|
|
vendors_menu = self.make_vendors_menu(request)
|
|
|
|
|
|
|
|
company_menu = self.make_company_menu(request)
|
|
|
|
|
|
|
|
batches_menu = self.make_batches_menu(request)
|
|
|
|
|
|
|
|
admin_menu = self.make_admin_menu(request,
|
|
|
|
include_stores=False,
|
|
|
|
include_tenders=False)
|
|
|
|
|
|
|
|
menus = [
|
|
|
|
products_menu,
|
|
|
|
vendors_menu,
|
|
|
|
company_menu,
|
|
|
|
batches_menu,
|
|
|
|
admin_menu,
|
|
|
|
]
|
|
|
|
|
|
|
|
return menus
|
|
|
|
|
|
|
|
def make_products_menu(self, request, **kwargs):
|
|
|
|
return {
|
2019-08-16 15:46:01 -05:00
|
|
|
'title': "Products",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Products",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'products',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'products.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Brands",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'brands',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'brands.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Report Codes",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'reportcodes',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'reportcodes.list',
|
|
|
|
},
|
|
|
|
],
|
2024-07-01 13:25:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
def make_vendors_menu(self, request, **kwargs):
|
|
|
|
return {
|
2019-08-16 15:46:01 -05:00
|
|
|
'title': "Vendors",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Vendors",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'vendors',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'vendors.list',
|
|
|
|
},
|
|
|
|
{'type': 'sep'},
|
|
|
|
{
|
|
|
|
'title': "Catalogs",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'vendorcatalogs',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'vendorcatalogs.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Upload New Catalog",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'vendorcatalogs.create',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'vendorcatalogs.create',
|
|
|
|
},
|
|
|
|
],
|
2024-07-01 13:25:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
def make_company_menu(self, request, **kwargs):
|
|
|
|
return {
|
2019-08-16 15:46:01 -05:00
|
|
|
'title': "Company",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Stores",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'stores',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'stores.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Departments",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'departments',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'departments.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Subdepartments",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'subdepartments',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'subdepartments.list',
|
|
|
|
},
|
|
|
|
{'type': 'sep'},
|
|
|
|
{
|
|
|
|
'title': "Employees",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'employees',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'employees.list',
|
|
|
|
},
|
|
|
|
{'type': 'sep'},
|
|
|
|
{
|
|
|
|
'title': "Customers",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'customers',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'customers.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Customer Groups",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'customergroups',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'customergroups.list',
|
|
|
|
},
|
|
|
|
],
|
2024-07-01 13:25:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
def make_batches_menu(self, request, **kwargs):
|
|
|
|
return {
|
2019-08-16 15:46:01 -05:00
|
|
|
'title': "Batches",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Handheld",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'batch.handheld',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'batch.handheld.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Inventory",
|
2024-07-01 13:25:31 -05:00
|
|
|
'route': 'batch.inventory',
|
2019-08-16 15:46:01 -05:00
|
|
|
'perm': 'batch.inventory.list',
|
|
|
|
},
|
|
|
|
],
|
2024-07-01 13:25:31 -05:00
|
|
|
}
|