Add "jump to" chooser in App Settings, for various "configure" pages
This commit is contained in:
parent
1244659064
commit
197d3de74a
2 changed files with 68 additions and 12 deletions
|
@ -125,6 +125,31 @@ class AppSettingsView(View):
|
|||
if not current_group:
|
||||
current_group = self.request.session.get('appsettings.current_group')
|
||||
|
||||
# TODO: this should come from somewhere else
|
||||
possible_config_options = [
|
||||
{'label': "DataSync",
|
||||
'route': 'datasync.configure'},
|
||||
{'label': "Email",
|
||||
'route': 'emailprofiles.configure'},
|
||||
{'label': "Importing / Exporting",
|
||||
'route': 'importing.configure'},
|
||||
{'label': "Products",
|
||||
'route': 'products.configure'},
|
||||
{'label': "Receiving",
|
||||
'route': 'receiving.configure'},
|
||||
{'label': "Reporting",
|
||||
'route': 'report_output.configure'},
|
||||
{'label': "Vendors",
|
||||
'route': 'vendors.configure'},
|
||||
]
|
||||
|
||||
config_options = []
|
||||
for option in possible_config_options:
|
||||
perm = option.get('perm', option['route'])
|
||||
if self.request.has_perm(perm):
|
||||
option['url'] = self.request.route_url(option['route'])
|
||||
config_options.append(option)
|
||||
|
||||
use_buefy = self.get_use_buefy()
|
||||
context = {
|
||||
'index_title': "App Settings",
|
||||
|
@ -133,6 +158,7 @@ class AppSettingsView(View):
|
|||
'groups': groups,
|
||||
'settings': settings,
|
||||
'use_buefy': use_buefy,
|
||||
'config_options': config_options,
|
||||
}
|
||||
if use_buefy:
|
||||
context['buefy_data'] = self.get_buefy_data(form, groups, settings)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue