From d06fcffe1d4d2222751ab1831989895374c590cb Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 26 Nov 2018 13:09:27 +0000 Subject: [PATCH 1/2] [IMP] website_sale: ability to set a cover (or other building block) in /shop/category/X This commit closes #29045 --- addons/website_sale/models/product.py | 1 + addons/website_sale/views/templates.xml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 727775b9027..d1ddf51c581 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -68,6 +68,7 @@ class ProductPublicCategory(models.Model): # buttons have consistent styling. # In this case, the default image is set by the js code. image = fields.Binary(attachment=True, help="This field holds the image used as image for the category, limited to 1024x1024px.") + website_description = fields.Html('Category Description', sanitize_attributes=False, translate=html_translate) image_medium = fields.Binary(string='Medium-sized image', attachment=True, help="Medium-sized image of the category. It is automatically " "resized as a 128x128px image, with aspect ratio preserved. " diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index e5c04dfbfc1..f773eca5a81 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -203,6 +203,9 @@
+
+
+
From 432997b9670b5fe1f3cd97776415c0bccf722807 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 27 Nov 2018 14:19:11 +0000 Subject: [PATCH 2/2] [IMP] website: support custom placeholder in empty-structure for editor Before this commit, the placeholder was hardcoded: 'Drag building blocks here' Now you can customize the placeholder using a data-editor-message attribute. --- addons/website/static/src/js/menu/edit.js | 3 ++- addons/website_sale/views/templates.xml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/website/static/src/js/menu/edit.js b/addons/website/static/src/js/menu/edit.js index fc5532a3a29..3ab52b7fdc7 100644 --- a/addons/website/static/src/js/menu/edit.js +++ b/addons/website/static/src/js/menu/edit.js @@ -80,7 +80,8 @@ var EditPageMenu = websiteNavbarData.WebsiteNavbarActionWidget.extend({ self.$welcomeMessage.remove(); } var $wrapwrap = $('#wrapwrap'); // TODO find this element another way - $wrapwrap.find('.oe_structure.oe_empty, [data-oe-type="html"]').attr('data-editor-message', _t('DRAG BUILDING BLOCKS HERE')); + var $htmlEditable = $wrapwrap.find('.oe_structure.oe_empty, [data-oe-type="html"]').not('[data-editor-message]'); + $htmlEditable.attr('data-editor-message', _t('DRAG BUILDING BLOCKS HERE')); var def = $.Deferred(); self.trigger_up('animation_start_demand', { editableMode: true, diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index f773eca5a81..401966fc0f3 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -203,9 +203,10 @@
-
-
-
+ + Drag building blocks here to customize the header for "" category. +
+