From b7facef52dcf72fac31f1d3c41ece5f4ae83bf33 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 18 Aug 2020 14:14:56 +0530 Subject: [PATCH] feat: Section with Features --- frappe/public/scss/page-builder.scss | 103 ++++++++++++++++++ .../section_with_features/__init__.py | 0 .../section_with_features.html | 27 +++++ .../section_with_features.json | 62 +++++++++++ 4 files changed, 192 insertions(+) create mode 100644 frappe/website/web_template/section_with_features/__init__.py create mode 100644 frappe/website/web_template/section_with_features/section_with_features.html create mode 100644 frappe/website/web_template/section_with_features/section_with_features.json diff --git a/frappe/public/scss/page-builder.scss b/frappe/public/scss/page-builder.scss index 506e281af7..55c67e6311 100644 --- a/frappe/public/scss/page-builder.scss +++ b/frappe/public/scss/page-builder.scss @@ -458,3 +458,106 @@ margin-right: auto; } } + +/* Section with Features */ + +.section-features { + display: grid; + + &[data-columns="2"] { + margin-top: 3.75rem; + grid-template-columns: repeat(2, 1fr); + gap: 6rem; + + .feature-title { + font-size: $font-size-xl; + font-weight: bold; + + @include media-breakpoint-up(md) { + font-size: $font-size-2xl; + } + } + + .feature-content { + font-size: $font-size-base; + margin-top: 1.75rem; + margin-bottom: 1.75rem; + + @include media-breakpoint-up(xl) { + font-size: $font-size-lg; + } + } + + .feature-icon { + margin-bottom: 2rem; + width: 3.375rem; + height: 3.375rem; + object-fit: contain; + } + } + + &[data-columns="3"] { + margin-top: 3rem; + grid-template-columns: repeat(3, 1fr); + gap: 4.875rem; + + .feature-title { + font-size: $font-size-lg; + font-weight: 600; + + @include media-breakpoint-up(md) { + font-size: $font-size-xl; + } + } + .feature-content { + font-size: $font-size-base; + margin-top: 1rem; + margin-bottom: 1rem; + } + + .feature-icon { + margin-bottom: 1.75rem; + width: 2.5rem; + height: 2.5rem; + object-fit: contain; + } + } + + &[data-columns="4"] { + margin-top: 2.5rem; + grid-template-columns: repeat(4, 1fr); + gap: 3.75rem; + + .feature-title { + font-size: $font-size-base; + font-weight: 600; + } + + .feature-content { + font-size: $font-size-sm; + margin-top: 0.875rem; + margin-bottom: 0.875rem; + } + + .feature-url { + font-size: $font-size-sm; + } + + .feature-icon { + margin-bottom: 1.5rem; + width: 2.375rem; + height: 2.375rem; + object-fit: contain; + } + } +} + +.section-feature { + display: flex; + flex-direction: column; +} + +.feature-url { + display: inline-block; + margin-top: auto; +} diff --git a/frappe/website/web_template/section_with_features/__init__.py b/frappe/website/web_template/section_with_features/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/website/web_template/section_with_features/section_with_features.html b/frappe/website/web_template/section_with_features/section_with_features.html new file mode 100644 index 0000000000..e0de409425 --- /dev/null +++ b/frappe/website/web_template/section_with_features/section_with_features.html @@ -0,0 +1,27 @@ +
+ {%- if title -%} +

{{ title }}

+ {%- endif -%} + {%- if subtitle -%} +

{{ subtitle }}

+ {%- endif -%} + +
+ {%- for feature in features -%} +
+ {%- if feature.icon -%} + Icon for {{ feature.title }} + {%- endif -%} + {%- if feature.title -%} +

{{ feature.title }}

+ {%- endif -%} + {%- if feature.content -%} +

{{ feature.content }}

+ {%- endif -%} + {%- if feature.url -%} + Learn more → + {%- endif -%} +
+ {%- endfor -%} +
+
diff --git a/frappe/website/web_template/section_with_features/section_with_features.json b/frappe/website/web_template/section_with_features/section_with_features.json new file mode 100644 index 0000000000..5aa06bffc0 --- /dev/null +++ b/frappe/website/web_template/section_with_features/section_with_features.json @@ -0,0 +1,62 @@ +{ + "creation": "2020-08-18 13:10:11.476496", + "docstatus": 0, + "doctype": "Web Template", + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 0 + }, + { + "fieldname": "subtitle", + "fieldtype": "Data", + "label": "Subtitle", + "reqd": 0 + }, + { + "fieldname": "columns", + "fieldtype": "Select", + "label": "Columns", + "options": "2\n3\n4", + "reqd": 0 + }, + { + "fieldname": "features", + "fieldtype": "Table Break", + "label": "Features", + "reqd": 0 + }, + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 0 + }, + { + "fieldname": "content", + "fieldtype": "Small Text", + "label": "Content", + "reqd": 0 + }, + { + "fieldname": "url", + "fieldtype": "Data", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "icon", + "fieldtype": "Attach Image", + "label": "Icon", + "reqd": 0 + } + ], + "idx": 0, + "modified": "2020-08-18 13:48:43.138779", + "modified_by": "Administrator", + "name": "Section with Features", + "owner": "Administrator", + "standard": 1 +} \ No newline at end of file