Add new views for App Info, and Configure App

and a way to specify version/url overrides for buefy, vue etc.

also, begin logic for "standard" admin menu
This commit is contained in:
Lance Edgar 2023-01-12 15:19:46 -06:00
parent 2163522e7c
commit d842a3d8e0
11 changed files with 752 additions and 26 deletions

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -403,3 +403,103 @@ def mark_allowed(request, menus):
if item['allowed'] and item.get('type') != 'sep':
topitem['allowed'] = True
break
def make_admin_menu(request, include_stores=False):
"""
Generate a typical Admin menu
"""
items = []
if include_stores:
items.append({
'title': "Stores",
'route': 'stores',
'perm': 'stores.list',
})
items.extend([
{
'title': "Users",
'route': 'users',
'perm': 'users.list',
},
{
'title': "User Events",
'route': 'userevents',
'perm': 'userevents.list',
},
{
'title': "Roles",
'route': 'roles',
'perm': 'roles.list',
},
{'type': 'sep'},
{
'title': "App Settings",
'route': 'appsettings',
'perm': 'settings.list',
},
{
'title': "Email Settings",
'route': 'emailprofiles',
'perm': 'emailprofiles.list',
},
{
'title': "Email Attempts",
'route': 'email_attempts',
'perm': 'email_attempts.list',
},
{
'title': "Raw Settings",
'route': 'settings',
'perm': 'settings.list',
},
{'type': 'sep'},
{
'title': "DataSync Changes",
'route': 'datasyncchanges',
'perm': 'datasync_changes.list',
},
{
'title': "DataSync Status",
'route': 'datasync.status',
'perm': 'datasync.status',
},
{
'title': "Importing / Exporting",
'route': 'importing',
'perm': 'importing.list',
},
{
'title': "Luigi Tasks",
'route': 'luigi',
'perm': 'luigi.list',
},
{
'title': "Tables",
'route': 'tables',
'perm': 'tables.list',
},
{
'title': "App Info",
'route': 'appinfo',
'perm': 'appinfo.list',
},
{
'title': "Configure App",
'route': 'appinfo.configure',
'perm': 'appinfo.configure',
},
{
'title': "Upgrades",
'route': 'upgrades',
'perm': 'upgrades.list',
},
])
return {
'title': "Admin",
'type': 'menu',
'items': items,
}