Use routes instead of urls, for menu definitions

This commit is contained in:
Lance Edgar 2022-08-22 16:51:41 -05:00
parent 0a150d2ae5
commit 1656a95066

View file

@ -41,30 +41,25 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "New Customer Order", 'title': "New Customer Order",
'url': url('custorders.create'), 'route': 'custorders.create',
'perm': 'custorders.create', 'perm': 'custorders.create',
}, },
{ {
'title': "All New Orders", 'title': "All New Orders",
'url': url('new_custorders'), 'route': 'new_custorders',
'perm': 'new_custorders.list', 'perm': 'new_custorders.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "All Customer Orders", 'title': "All Customer Orders",
'url': url('custorders'), 'route': 'custorders',
'perm': 'custorders.list', 'perm': 'custorders.list',
}, },
{ {
'title': "All Order Items", 'title': "All Order Items",
'url': url('custorders.items'), 'route': 'custorders.items',
'perm': 'custorders.items.list', 'perm': 'custorders.items.list',
}, },
# {
# 'title': "Configuration",
# 'url': url('custorders.config'),
# 'perm': 'custorders.configure',
# },
], ],
} }
@ -74,28 +69,28 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "Members", 'title': "Members",
'url': url('members'), 'route': 'members',
'perm': 'members.list', 'perm': 'members.list',
}, },
{ {
'title': "Customers", 'title': "Customers",
'url': url('customers'), 'route': 'customers',
'perm': 'customers.list', 'perm': 'customers.list',
}, },
{ {
'title': "Employees", 'title': "Employees",
'url': url('employees'), 'route': 'employees',
'perm': 'employees.list', 'perm': 'employees.list',
}, },
{ {
'title': "All People", 'title': "All People",
'url': url('people'), 'route': 'people',
'perm': 'people.list', 'perm': 'people.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Pending Customers", 'title': "Pending Customers",
'url': url('pending_customers'), 'route': 'pending_customers',
'perm': 'pending_customers.list', 'perm': 'pending_customers.list',
}, },
], ],
@ -107,38 +102,38 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "Products", 'title': "Products",
'url': url('products'), 'route': 'products',
'perm': 'products.list', 'perm': 'products.list',
}, },
{ {
'title': "Departments", 'title': "Departments",
'url': url('departments'), 'route': 'departments',
'perm': 'departments.list', 'perm': 'departments.list',
}, },
{ {
'title': "Subdepartments", 'title': "Subdepartments",
'url': url('subdepartments'), 'route': 'subdepartments',
'perm': 'subdepartments.list', 'perm': 'subdepartments.list',
}, },
{ {
'title': "Brands", 'title': "Brands",
'url': url('brands'), 'route': 'brands',
'perm': 'brands.list', 'perm': 'brands.list',
}, },
{ {
'title': "Taxes", 'title': "Taxes",
'url': url('taxes'), 'route': 'taxes',
'perm': 'taxes.list', 'perm': 'taxes.list',
}, },
{ {
'title': "Units of Measure", 'title': "Units of Measure",
'url': url('uoms'), 'route': 'uoms',
'perm': 'uoms.list', 'perm': 'uoms.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Pending Products", 'title': "Pending Products",
'url': url('pending_products'), 'route': 'pending_products',
'perm': 'pending_products.list', 'perm': 'pending_products.list',
}, },
], ],
@ -150,35 +145,35 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "Vendors", 'title': "Vendors",
'url': url('vendors'), 'route': 'vendors',
'perm': 'vendors.list', 'perm': 'vendors.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Ordering", 'title': "Ordering",
'url': url('ordering'), 'route': 'ordering',
'perm': 'ordering.list', 'perm': 'ordering.list',
}, },
{ {
'title': "Receiving", 'title': "Receiving",
'url': url('receiving'), 'route': 'receiving',
'perm': 'receiving.list', 'perm': 'receiving.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Purchases", 'title': "Purchases",
'url': url('purchases'), 'route': 'purchases',
'perm': 'purchases.list', 'perm': 'purchases.list',
}, },
{ {
'title': "Credits", 'title': "Credits",
'url': url('purchases.credits'), 'route': 'purchases.credits',
'perm': 'purchases.credits.list', 'perm': 'purchases.credits.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Catalog Batches", 'title': "Catalog Batches",
'url': url('vendorcatalogs'), 'route': 'vendorcatalogs',
'perm': 'vendorcatalogs.list', 'perm': 'vendorcatalogs.list',
}, },
], ],
@ -209,24 +204,24 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "New Report", 'title': "New Report",
'url': url('report_output.create'), 'route': 'report_output.create',
'perm': 'report_output.create', 'perm': 'report_output.create',
}, },
{ {
'title': "Generated Reports", 'title': "Generated Reports",
'url': url('report_output'), 'route': 'report_output',
'perm': 'report_output.list', 'perm': 'report_output.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Trainwreck", 'title': "Trainwreck",
'url': url('trainwreck.transactions'), 'route': 'trainwreck.transactions',
'perm': 'trainwreck.transactions.list', 'perm': 'trainwreck.transactions.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "Problem Reports", 'title': "Problem Reports",
'url': url('problem_reports'), 'route': 'problem_reports',
'perm': 'problem_reports.list', 'perm': 'problem_reports.list',
}, },
], ],
@ -238,48 +233,48 @@ def simple_menus(request):
'items': [ 'items': [
{ {
'title': "Stores", 'title': "Stores",
'url': url('stores'), 'route': 'stores',
'perm': 'stores.list', 'perm': 'stores.list',
}, },
{ {
'title': "Users", 'title': "Users",
'url': url('users'), 'route': 'users',
'perm': 'users.list', 'perm': 'users.list',
}, },
{ {
'title': "User Events", 'title': "User Events",
'url': url('userevents'), 'route': 'userevents',
'perm': 'userevents.list', 'perm': 'userevents.list',
}, },
{ {
'title': "Roles", 'title': "Roles",
'url': url('roles'), 'route': 'roles',
'perm': 'roles.list', 'perm': 'roles.list',
}, },
{ {
'title': "Raw Permissions", 'title': "Raw Permissions",
'url': url('permissions'), 'route': 'permissions',
'perm': 'permissions.list', 'perm': 'permissions.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
{ {
'title': "App Settings", 'title': "App Settings",
'url': url('appsettings'), 'route': 'appsettings',
'perm': 'settings.list', 'perm': 'settings.list',
}, },
{ {
'title': "Email Settings", 'title': "Email Settings",
'url': url('emailprofiles'), 'route': 'emailprofiles',
'perm': 'emailprofiles.list', 'perm': 'emailprofiles.list',
}, },
{ {
'title': "Email Attempts", 'title': "Email Attempts",
'url': url('email_attempts'), 'route': 'email_attempts',
'perm': 'email_attempts.list', 'perm': 'email_attempts.list',
}, },
{ {
'title': "Raw Settings", 'title': "Raw Settings",
'url': url('settings'), 'route': 'settings',
'perm': 'settings.list', 'perm': 'settings.list',
}, },
{'type': 'sep'}, {'type': 'sep'},
@ -295,7 +290,7 @@ def simple_menus(request):
}, },
{ {
'title': "Importing / Exporting", 'title': "Importing / Exporting",
'url': url('importing'), 'route': 'importing',
'perm': 'importing.list', 'perm': 'importing.list',
}, },
{ {
@ -305,12 +300,12 @@ def simple_menus(request):
}, },
{ {
'title': "Tables", 'title': "Tables",
'url': url('tables'), 'route': 'tables',
'perm': 'tables.list', 'perm': 'tables.list',
}, },
{ {
'title': "Theo Upgrades", 'title': "Upgrades",
'url': url('upgrades'), 'route': 'upgrades',
'perm': 'upgrades.list', 'perm': 'upgrades.list',
}, },
], ],