messkit/messkit/web/menus.py
Lance Edgar e688cbab6a Misc. tweaks for fresh install
give more menus, define app_package, no more custom views..
2022-03-04 17:45:59 -06:00

142 lines
3.9 KiB
Python

# -*- coding: utf-8; -*-
######################################################################
#
# Messkit -- Generic-ish Data Utility App
# Copyright © 2022 Lance Edgar
#
# This file is part of Messkit.
#
# Messkit 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.
#
# Messkit 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 Messkit. If not, see <http://www.gnu.org/licenses/>.
#
######################################################################
"""
Web Menus
"""
def simple_menus(request):
url = request.route_url
people_menu = {
'title': "People",
'type': 'menu',
'items': [
{
'title': "All People",
'route': 'people',
'perm': 'people.list',
},
],
}
reports_menu = {
'title': "Reports",
'type': 'menu',
'items': [
{
'title': "New Report",
'route': 'report_output.create',
'perm': 'report_output.create',
},
{
'title': "Generated Reports",
'route': 'report_output',
'perm': 'report_output.list',
},
{
'title': "Problem Reports",
'route': 'problem_reports',
'perm': 'problem_reports.list',
},
{'type': 'sep'},
{
'title': "Poser Reports",
'route': 'poser.reports',
'perm': 'poser.reports.list',
},
],
}
admin_menu = {
'title': "Admin",
'type': 'menu',
'items': [
{
'title': "Users",
'url': url('users'),
'perm': 'users.list',
},
# {
# 'title': "User Events",
# 'url': url('userevents'),
# 'perm': 'userevents.list',
# },
{
'title': "Roles",
'url': url('roles'),
'perm': 'roles.list',
},
{'type': 'sep'},
{
'title': "App Settings",
'url': url('appsettings'),
'perm': 'settings.list',
},
{
'title': "Email Settings",
'url': url('emailprofiles'),
'perm': 'emailprofiles.list',
},
{
'title': "Email Attempts",
'url': url('email_attempts'),
'perm': 'email_attempts.list',
},
{
'title': "Raw Settings",
'url': url('settings'),
'perm': 'settings.list',
},
{'type': 'sep'},
# {
# 'title': "DataSync Changes",
# 'url': url('datasyncchanges'),
# 'perm': 'datasync_changes.list',
# },
# {
# 'title': "Importing / Exporting",
# 'url': url('importing'),
# 'perm': 'importing.list',
# },
{
'title': "Tables",
'url': url('tables'),
'perm': 'tables.list',
},
{
'title': "Messkit Upgrades",
'url': url('upgrades'),
'perm': 'upgrades.list',
},
],
}
menus = [
people_menu,
reports_menu,
admin_menu,
]
return menus