From 16bc3076ad0801c694bb618c52ef556f98ec8045 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 13 Dec 2021 21:06:47 -0600 Subject: [PATCH] Add basic config page for Products --- tailbone/templates/products/configure.mako | 69 ++++++++++++++++++++++ tailbone/views/products.py | 17 ++++++ 2 files changed, 86 insertions(+) create mode 100644 tailbone/templates/products/configure.mako diff --git a/tailbone/templates/products/configure.mako b/tailbone/templates/products/configure.mako new file mode 100644 index 00000000..045e5904 --- /dev/null +++ b/tailbone/templates/products/configure.mako @@ -0,0 +1,69 @@ +## -*- coding: utf-8; -*- +<%inherit file="/configure.mako" /> + +<%def name="page_content()"> + ${parent.page_content()} + +

Key Field

+
+ + + + + + + + + + + + + + + + + + +
+ +

Display

+
+ + + + Show "POD" Images as fallback + + + +
+ + +<%def name="modify_this_page_vars()"> + ${parent.modify_this_page_vars()} + + + + +${parent.body()} diff --git a/tailbone/views/products.py b/tailbone/views/products.py index 97f0b631..e6d2b7d4 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -85,6 +85,7 @@ class ProductView(MasterView): has_versions = True results_downloadable_xlsx = True supports_autocomplete = True + configurable = True labels = { 'item_id': "Item ID", @@ -1906,6 +1907,22 @@ class ProductView(MasterView): if batch.batch_key == 'delproduct': return self.request.route_url('batch.delproduct.view', uuid=batch.uuid) + def configure_get_simple_settings(self): + config = self.rattail_config + return [ + + # key field + {'section': 'rattail', + 'option': 'product.key'}, + {'section': 'rattail', + 'option': 'product.key_title'}, + + # display + {'section': 'tailbone', + 'option': 'products.show_pod_image', + 'type': bool}, + ] + @classmethod def defaults(cls, config): cls._product_defaults(config)