From 7234b4b7fa06edea8c43a930590c657d76629133 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 19 May 2020 00:45:12 +0530 Subject: [PATCH] fix: Add Split Section template --- frappe/public/scss/page-builder.scss | 4 ++ .../split_section_with_image/__init__.py | 0 .../split_section_with_image.html | 24 ++++++++++++ .../split_section_with_image.json | 38 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 frappe/website/web_template/split_section_with_image/__init__.py create mode 100644 frappe/website/web_template/split_section_with_image/split_section_with_image.html create mode 100644 frappe/website/web_template/split_section_with_image/split_section_with_image.json diff --git a/frappe/public/scss/page-builder.scss b/frappe/public/scss/page-builder.scss index d28f0c593c..f59e589afe 100644 --- a/frappe/public/scss/page-builder.scss +++ b/frappe/public/scss/page-builder.scss @@ -278,3 +278,7 @@ content: '—' } } + +.split-section-content { + margin-top: 2rem; +} diff --git a/frappe/website/web_template/split_section_with_image/__init__.py b/frappe/website/web_template/split_section_with_image/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/website/web_template/split_section_with_image/split_section_with_image.html b/frappe/website/web_template/split_section_with_image/split_section_with_image.html new file mode 100644 index 0000000000..2a2f7a920e --- /dev/null +++ b/frappe/website/web_template/split_section_with_image/split_section_with_image.html @@ -0,0 +1,24 @@ +
+ {%- if not image_on_right -%} +
+ {{ frappe.render_template('templates/includes/image_with_blur.html', { + "src": image, + "alt": title, + "class": "split-section-image" + }) }} +
+ {%- endif -%} +
+

{{ title }}

+

{{ content }}

+
+ {%- if image_on_right -%} +
+ {{ frappe.render_template('templates/includes/image_with_blur.html', { + "src": image, + "alt": title, + "class": "split-section-image" + }) }} +
+ {%- endif -%} +
diff --git a/frappe/website/web_template/split_section_with_image/split_section_with_image.json b/frappe/website/web_template/split_section_with_image/split_section_with_image.json new file mode 100644 index 0000000000..c3885c33d1 --- /dev/null +++ b/frappe/website/web_template/split_section_with_image/split_section_with_image.json @@ -0,0 +1,38 @@ +{ + "creation": "2020-05-17 06:37:27.461722", + "docstatus": 0, + "doctype": "Web Template", + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 0 + }, + { + "fieldname": "content", + "fieldtype": "Small Text", + "label": "Content", + "reqd": 0 + }, + { + "fieldname": "image", + "fieldtype": "Attach Image", + "label": "Image", + "reqd": 0 + }, + { + "fieldname": "image_on_right", + "fieldtype": "Check", + "label": "Image on Right", + "reqd": 0 + } + ], + "idx": 0, + "modified": "2020-05-17 06:37:27.461722", + "modified_by": "Administrator", + "name": "Split Section with Image", + "owner": "Administrator", + "standard": 1, + "template": "" +} \ No newline at end of file