diff --git a/tailbone/templates/master/configure.mako b/tailbone/templates/master/configure.mako index 4c007730..bfe0574c 100644 --- a/tailbone/templates/master/configure.mako +++ b/tailbone/templates/master/configure.mako @@ -24,6 +24,7 @@ diff --git a/tailbone/templates/reports/generated/configure.mako b/tailbone/templates/reports/generated/configure.mako new file mode 100644 index 00000000..27e60afa --- /dev/null +++ b/tailbone/templates/reports/generated/configure.mako @@ -0,0 +1,21 @@ +## -*- coding: utf-8; -*- +<%inherit file="/configure.mako" /> + +<%def name="page_content()"> + ${parent.page_content()} + +

Generating

+
+ + + + Show report chooser as form, with dropdown + + + +
+ + + +${parent.body()} diff --git a/tailbone/templates/settings/email/configure.mako b/tailbone/templates/settings/email/configure.mako new file mode 100644 index 00000000..f212f635 --- /dev/null +++ b/tailbone/templates/settings/email/configure.mako @@ -0,0 +1,21 @@ +## -*- coding: utf-8; -*- +<%inherit file="/configure.mako" /> + +<%def name="page_content()"> + ${parent.page_content()} + +

Sending

+
+ + + + Make record of all attempts to send email + + + +
+ + + +${parent.body()} diff --git a/tailbone/templates/vendors/configure.mako b/tailbone/templates/vendors/configure.mako new file mode 100644 index 00000000..e1a47644 --- /dev/null +++ b/tailbone/templates/vendors/configure.mako @@ -0,0 +1,21 @@ +## -*- coding: utf-8; -*- +<%inherit file="/configure.mako" /> + +<%def name="page_content()"> + ${parent.page_content()} + +

Display

+
+ + + + Show vendor chooser as autocomplete field + + + +
+ + + +${parent.body()} diff --git a/tailbone/views/email.py b/tailbone/views/email.py index 58a0320b..7b46f490 100644 --- a/tailbone/views/email.py +++ b/tailbone/views/email.py @@ -54,6 +54,8 @@ class EmailSettingView(MasterView): pageable = False creatable = False deletable = False + configurable = True + config_title = "Email" grid_columns = [ 'key', @@ -224,6 +226,16 @@ class EmailSettingView(MasterView): kwargs['email'] = self.handler.get_email(key) return kwargs + def configure_get_simple_settings(self): + config = self.rattail_config + return [ + + # sending + {'section': 'rattail.mail', + 'option': 'record_attempts', + 'type': bool}, + ] + # TODO: deprecate / remove this ProfilesView = EmailSettingView diff --git a/tailbone/views/master.py b/tailbone/views/master.py index dce2d3ef..76f8967b 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -287,6 +287,12 @@ class MasterView(View): return self.request.has_perm('{}.{}'.format( self.get_permission_prefix(), name)) + @classmethod + def get_config_url(cls): + if hasattr(cls, 'config_url'): + return cls.config_url + return '{}/configure'.format(cls.get_url_prefix()) + ############################## # Available Views ############################## @@ -4265,7 +4271,7 @@ class MasterView(View): '{}.configure'.format(permission_prefix), label="Configure {}".format(config_title)) config.add_route('{}.configure'.format(route_prefix), - '{}/configure'.format(url_prefix)) + cls.get_config_url()) config.add_view(cls, attr='configure', route_name='{}.configure'.format(route_prefix), permission='{}.configure'.format(permission_prefix)) diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index 6359c471..21ef3a20 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -213,6 +213,9 @@ class ReportOutputView(ExportMasterView): route_prefix = 'report_output' url_prefix = '/reports/generated' downloadable = True + configurable = True + config_title = "Reporting" + config_url = '/reports/configure' grid_columns = [ 'id', @@ -295,6 +298,16 @@ class ReportOutputView(ExportMasterView): path = report.filepath(self.rattail_config) return self.file_response(path) + def configure_get_simple_settings(self): + config = self.rattail_config + return [ + + # generating + {'section': 'tailbone', + 'option': 'reporting.choosing_uses_form', + 'type': bool}, + ] + class GenerateReport(View): """ diff --git a/tailbone/views/vendors/core.py b/tailbone/views/vendors/core.py index ceac1c71..bf73e1b1 100644 --- a/tailbone/views/vendors/core.py +++ b/tailbone/views/vendors/core.py @@ -43,6 +43,7 @@ class VendorView(MasterView): has_versions = True touchable = True supports_autocomplete = True + configurable = True labels = { 'id': "ID", @@ -168,6 +169,16 @@ class VendorView(MasterView): (model.VendorContact, 'vendor_uuid'), ] + def configure_get_simple_settings(self): + config = self.rattail_config + return [ + + # display + {'section': 'rattail', + 'option': 'vendor.use_autocomplete', + 'type': bool}, + ] + def includeme(config): VendorView.defaults(config)