2018-11-29 01:40:18 -06:00
|
|
|
# -*- coding: utf-8; -*-
|
|
|
|
"""
|
|
|
|
Web Menus
|
|
|
|
"""
|
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
from tailbone import menus as base
|
2020-09-16 16:15:53 -05:00
|
|
|
from tailbone_corepos.menus import make_corepos_menu
|
|
|
|
|
2018-11-29 01:40:18 -06:00
|
|
|
|
2024-07-14 11:37:36 -05:00
|
|
|
class DemoMenuHandler(base.TailboneMenuHandler):
|
2023-01-14 16:13:58 -06:00
|
|
|
"""
|
|
|
|
Demo menu handler
|
|
|
|
"""
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
def make_menus(self, request, **kwargs):
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
people_menu = self.make_people_menu(request)
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
products_menu = self.make_products_menu(request)
|
2018-11-29 01:40:18 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
vendors_menu = self.make_vendors_menu(request)
|
2020-09-16 16:15:53 -05:00
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
corepos_menu = make_corepos_menu(request)
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
shopfoo_menu = {
|
|
|
|
'title': "Shopfoo",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Products",
|
|
|
|
'route': 'shopfoo.products',
|
|
|
|
'perm': 'shopfoo.products.list',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Product Exports",
|
|
|
|
'route': 'shopfoo.product_exports',
|
|
|
|
'perm': 'shopfoo.product_exports.list',
|
|
|
|
},
|
|
|
|
{'type': 'sep'},
|
|
|
|
{
|
|
|
|
'title': "WooCommerce Products",
|
|
|
|
'route': 'woocommerce.products',
|
|
|
|
'perm': 'woocommerce.products.list',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
2021-12-07 18:06:12 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
reports_menu = self.make_reports_menu(request, include_trainwreck=True)
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
batch_menu = self.make_batches_menu(request)
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
tempmon_menu = self.make_tempmon_menu(request)
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
other_menu = {
|
|
|
|
'title': "Other",
|
|
|
|
'type': 'menu',
|
|
|
|
'items': [
|
|
|
|
{
|
|
|
|
'title': "Documentation",
|
|
|
|
'url': 'https://rattailproject.org/moin/RattailDemo',
|
|
|
|
'target': '_blank',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "Source Code",
|
2024-09-14 13:19:35 -05:00
|
|
|
'url': 'https://forgejo.wuttaproject.org/rattail/rattail-demo',
|
2023-01-14 16:13:58 -06:00
|
|
|
'target': '_blank',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'title': "RattailProject.org",
|
|
|
|
'url': 'https://rattailproject.org',
|
|
|
|
'target': '_blank',
|
|
|
|
},
|
|
|
|
{'type': 'sep'},
|
|
|
|
{
|
|
|
|
'title': "Generate New Project",
|
2023-05-05 10:46:04 -05:00
|
|
|
'route': 'generated_projects.create',
|
|
|
|
'perm': 'generated_projects.create',
|
2023-01-14 16:13:58 -06:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
2021-02-18 20:20:31 -06:00
|
|
|
|
2023-01-18 14:59:26 -06:00
|
|
|
admin_menu = self.make_admin_menu(request, include_stores=True)
|
2018-11-29 01:40:18 -06:00
|
|
|
|
2023-01-14 16:13:58 -06:00
|
|
|
menus = [
|
|
|
|
people_menu,
|
|
|
|
products_menu,
|
|
|
|
vendors_menu,
|
|
|
|
corepos_menu,
|
|
|
|
shopfoo_menu,
|
2023-01-18 14:59:26 -06:00
|
|
|
reports_menu,
|
2023-01-14 16:13:58 -06:00
|
|
|
batch_menu,
|
|
|
|
tempmon_menu,
|
|
|
|
other_menu,
|
|
|
|
admin_menu,
|
2023-01-18 14:59:26 -06:00
|
|
|
]
|
2023-01-14 16:13:58 -06:00
|
|
|
|
|
|
|
return menus
|