diff --git a/tailbone/menus.py b/tailbone/menus.py
index a9de79dc..e956685d 100644
--- a/tailbone/menus.py
+++ b/tailbone/menus.py
@@ -501,20 +501,10 @@ class MenuHandler(GenericHandler):
'perm': 'luigi.list',
},
{
- 'title': "Tables",
- 'route': 'tables',
- 'perm': 'tables.list',
- },
- {
- 'title': "App Info",
+ 'title': "App Details",
'route': 'appinfo',
'perm': 'appinfo.list',
},
- {
- 'title': "Configure App",
- 'route': 'appinfo.configure',
- 'perm': 'appinfo.configure',
- },
{
'title': "Upgrades",
'route': 'upgrades',
diff --git a/tailbone/templates/appinfo/index.mako b/tailbone/templates/appinfo/index.mako
index 4bf70354..9b50b8a9 100644
--- a/tailbone/templates/appinfo/index.mako
+++ b/tailbone/templates/appinfo/index.mako
@@ -3,6 +3,31 @@
<%def name="render_grid_component()">
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tailbone/templates/configure-menus.mako b/tailbone/templates/configure-menus.mako
index 495b5c65..c0200912 100644
--- a/tailbone/templates/configure-menus.mako
+++ b/tailbone/templates/configure-menus.mako
@@ -14,6 +14,12 @@
%def>
<%def name="form_content()">
+
+ ## nb. must be root to configure menus! otherwise some of the
+ ## currently-defined menus may not appear on the page, so saving
+ ## would inadvertently remove them!
+ % if request.is_root:
+
${h.hidden('menus', **{':value': 'JSON.stringify(allMenuData)'})}
Top-Level Menus
@@ -182,6 +188,24 @@
+ % else:
+ ## not root!
+
+
+ You must become root to configure menus!
+
+
+ % endif
+
+%def>
+
+## TODO: should probably make some global "editable" flag that the
+## base configure template has knowledge of, and just set that to
+## false for this view
+<%def name="purge_button()">
+ % if request.is_root:
+ ${parent.purge_button()}
+ % endif
%def>
<%def name="modify_this_page_vars()">
diff --git a/tailbone/templates/themes/falafel/base.mako b/tailbone/templates/themes/falafel/base.mako
index adbcd893..2db0547f 100644
--- a/tailbone/templates/themes/falafel/base.mako
+++ b/tailbone/templates/themes/falafel/base.mako
@@ -383,7 +383,7 @@
tag="a"
href="${url('{}.configure'.format(route_prefix))}"
icon-left="cog"
- text="Configure">
+ text="${(configure_button_title or "Configure") if configure_button_title is not Undefined else "Configure"}">
% endif
diff --git a/tailbone/views/menus.py b/tailbone/views/menus.py
index 37c2536c..a25b1543 100644
--- a/tailbone/views/menus.py
+++ b/tailbone/views/menus.py
@@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
-# Copyright © 2010-2022 Lance Edgar
+# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@@ -63,8 +63,8 @@ class MenuConfigView(View):
context = {
'config_title': "Menus",
'use_buefy': True,
- 'index_title': "App Settings",
- 'index_url': self.request.route_url('appsettings'),
+ 'index_title': "App Details",
+ 'index_url': self.request.route_url('appinfo'),
}
possible_index_options = sorted(
@@ -173,9 +173,7 @@ class MenuConfigView(View):
'/configure-menus')
config.add_view(cls, attr='configure',
route_name='configure_menus',
- # nb. must be root to configure menus! b/c
- # otherwise some route options may be hidden
- permission='admin',
+ permission='appinfo.configure',
renderer='/configure-menus.mako')
config.add_tailbone_config_page('configure_menus', "Menus", 'admin')
diff --git a/tailbone/views/settings.py b/tailbone/views/settings.py
index 72ee704e..190b8b78 100644
--- a/tailbone/views/settings.py
+++ b/tailbone/views/settings.py
@@ -54,7 +54,7 @@ class AppInfoView(MasterView):
route_prefix = 'appinfo'
model_key = 'UNUSED'
model_title = "UNUSED"
- model_title_plural = "App Info"
+ model_title_plural = "App Details"
creatable = False
viewable = False
editable = False
@@ -70,7 +70,8 @@ class AppInfoView(MasterView):
]
def get_index_title(self):
- return "App Info for {}".format(self.rattail_config.app_title())
+ return "{} for {}".format(self.get_model_title_plural(),
+ self.rattail_config.app_title())
def get_data(self, session=None):
pip = os.path.join(sys.prefix, 'bin', 'pip')
@@ -95,6 +96,11 @@ class AppInfoView(MasterView):
'editable_project_location', foldcase=True)
g.set_searchable('editable_project_location')
+ def template_kwargs_index(self, **kwargs):
+ kwargs = super(AppInfoView, self).template_kwargs_index(**kwargs)
+ kwargs['configure_button_title'] = "Configure App"
+ return kwargs
+
def configure_get_context(self, **kwargs):
context = super(AppInfoView, self).configure_get_context(**kwargs)
diff --git a/tailbone/views/views.py b/tailbone/views/views.py
index 64f94112..25828cde 100644
--- a/tailbone/views/views.py
+++ b/tailbone/views/views.py
@@ -86,6 +86,7 @@ class ModelViewView(MasterView):
g.sorters['label'] = g.make_simple_sorter('label')
g.set_sort_defaults('label')
g.set_link('label')
+ g.set_searchable('label')
# model_name
g.sorters['model_name'] = g.make_simple_sorter('model_name', foldcase=True)
@@ -93,12 +94,14 @@ class ModelViewView(MasterView):
# route
g.sorters['route'] = g.make_simple_sorter('route')
+ g.set_searchable('route')
# permission
g.sorters['permission'] = g.make_simple_sorter('permission')
+ g.set_searchable('permission')
- def default_view_url(self, view, i=None):
- return self.request.route_url(view['route_prefix'])
+ def default_view_url(self):
+ return lambda view, i: self.request.route_url(view['route_prefix'])
def make_form_schema(self):
return ModelViewSchema()