Use upstream menus completely

This commit is contained in:
Lance Edgar 2023-01-18 17:26:12 -06:00
parent 4dec538418
commit 8cc0e2755d
3 changed files with 1 additions and 88 deletions

View file

@ -38,9 +38,6 @@ class TheoConfig(ConfigExtension):
# call the app "Theo" by default
config.setdefault('rattail', 'app_title', "Theo")
# Theo comes with its own menu for web app
config.setdefault('tailbone.menus', 'handler', 'theo.web.menus:TheoMenuHandler')
# Trainwreck model is same regardless of POS
config.setdefault('rattail.trainwreck', 'model', 'rattail.trainwreck.db.model.defaults')

View file

@ -1,69 +0,0 @@
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2023 Lance Edgar
#
# 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/>.
#
################################################################################
"""
Web Menus
"""
from tailbone import menus as base
from theo.config import integrate_catapult, integrate_corepos, integrate_locsms
class TheoMenuHandler(base.MenuHandler):
"""
Theo menu handler
"""
def make_menus(self, request, **kwargs):
menus = [
self.make_custorders_menu(request),
self.make_people_menu(request),
self.make_products_menu(request),
self.make_vendors_menu(request),
]
# TODO: pretty sure this should handle things?
# TODO: ..if so then 100% upstream menu should work here?
# integration_menus = self.make_integration_menus(request)
# if integration_menus:
# menus.extend(integration_menus)
if integrate_catapult(self.config):
from tailbone_onager.menus import make_catapult_menu
menus.append(make_catapult_menu(request))
if integrate_corepos(self.config):
from tailbone_corepos.menus import make_corepos_menu
menus.append(make_corepos_menu(request))
if integrate_locsms(self.config):
from tailbone_locsms.menus import make_locsms_menu
menus.append(make_locsms_menu(request))
menus.extend([
self.make_reports_menu(request, include_trainwreck=True),
self.make_admin_menu(request, include_stores=True),
])
return menus

View file

@ -30,36 +30,21 @@ from theo.config import integrate_catapult, integrate_corepos, integrate_locsms
def includeme(config):
rattail_config = config.registry.settings.get('rattail_config')
# core views
config.include('theo.web.views.common')
config.include('tailbone.views.auth')
config.include('tailbone.views.importing')
config.include('tailbone.views.luigi')
config.include('tailbone.views.tables')
config.include('tailbone.views.upgrades')
config.include('tailbone.views.progress')
config.include('tailbone.views.essentials')
# main table views
config.include('tailbone.views.brands')
config.include('tailbone.views.customergroups')
config.include('tailbone.views.customers')
config.include('tailbone.views.datasync')
config.include('tailbone.views.departments')
config.include('tailbone.views.email')
config.include('tailbone.views.employees')
config.include('tailbone.views.members')
config.include('tailbone.views.messages')
config.include('tailbone.views.people')
config.include('tailbone.views.permissions')
config.include('tailbone.views.products')
config.include('tailbone.views.reportcodes')
config.include('tailbone.views.reports')
config.include('tailbone.views.roles')
config.include('tailbone.views.settings')
config.include('tailbone.views.stores')
config.include('tailbone.views.subdepartments')
config.include('tailbone.views.taxes')
config.include('tailbone.views.users')
config.include('tailbone.views.uoms')
config.include('tailbone.views.vendors')