From 7a6a9b2b207733dc77821b2e5d382fe28e89bc2a Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 14:15:06 +0530 Subject: [PATCH 01/10] fix: Use standard button components in Hero --- frappe/website/web_template/hero/hero.html | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/frappe/website/web_template/hero/hero.html b/frappe/website/web_template/hero/hero.html index a3fb4aa466..e7b69ab782 100644 --- a/frappe/website/web_template/hero/hero.html +++ b/frappe/website/web_template/hero/hero.html @@ -9,22 +9,12 @@

{%- endif -%} {%- if primary_action or secondary_action -%} -
+
{%- if primary_action -%} - + {{ c('button', label=primary_action_label, url=primary_action, variant="primary", size="large") }} {%- endif -%} {%- if secondary_action -%} - + {{ c('button', label=secondary_action_label, url=secondary_action, variant="secondary", size="large", class="ml-4") }} {%- endif -%}
{%- endif -%} From 811d0d64d90986bf637b0c4608327e212766ddd7 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 14:15:46 +0530 Subject: [PATCH 02/10] fix: Option to bleed image outside Hero --- .../hero_with_right_image.html | 16 ++++++++++++---- .../hero_with_right_image.json | 8 +++++++- .../website/website_theme/standard/standard.json | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html index 57a1a02af7..11d49eb287 100644 --- a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html +++ b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html @@ -1,5 +1,5 @@
-
+

@@ -22,8 +22,16 @@

{%- if image -%} - + {{ c('image_with_blur', + class=["hidden md:block", "w-full md:w-6/12" if contain_image else "md:max-w-md lg:max-w-lg xl:max-w-xl xxl:max-w-2xl"], + src=image, + alt="") + }} {%- endif -%}
+ +{%- if not contain_image -%} + +{%- endif -%} diff --git a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.json b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.json index bb841a3156..3cb4701e7c 100644 --- a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.json +++ b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.json @@ -21,6 +21,12 @@ "label": "Image", "reqd": 0 }, + { + "fieldname": "contain_image", + "fieldtype": "Check", + "label": "Restrict Image inside Container", + "reqd": 0 + }, { "fieldname": "primary_action_label", "fieldtype": "Data", @@ -47,7 +53,7 @@ } ], "idx": 0, - "modified": "2020-04-26 15:08:26.937576", + "modified": "2020-04-29 14:12:31.613545", "modified_by": "Administrator", "name": "Hero with Right Image", "owner": "Administrator", diff --git a/frappe/website/website_theme/standard/standard.json b/frappe/website/website_theme/standard/standard.json index ca9e81bf27..1729e4616a 100644 --- a/frappe/website/website_theme/standard/standard.json +++ b/frappe/website/website_theme/standard/standard.json @@ -10,7 +10,7 @@ "font_properties": "300,600", "footer": [], "idx": 26, - "modified": "2020-04-24 23:52:27.211811", + "modified": "2020-04-29 12:26:48.399125", "modified_by": "Administrator", "module": "Website", "name": "Standard", From 551722c7254b77ccb391552168ecac871f587b34 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 23:01:16 +0530 Subject: [PATCH 03/10] fix: Ability to hide blocks --- frappe/templates/components/web_block.html | 2 ++ .../doctype/web_page_block/web_page_block.json | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frappe/templates/components/web_block.html b/frappe/templates/components/web_block.html index d898417970..f0ed8f2df4 100644 --- a/frappe/templates/components/web_block.html +++ b/frappe/templates/components/web_block.html @@ -7,6 +7,7 @@ web_block.css_class ]) -%} +{%- if not web_block.hide_block -%} <{{htmltag}} class="{{ classes }}" data-section-idx="{{ web_block.idx | e }}" data-section-template="{{ web_block.web_template | e }}"> {%- if web_block.add_container -%} @@ -17,3 +18,4 @@
{%- endif -%} +{%- endif -%} diff --git a/frappe/website/doctype/web_page_block/web_page_block.json b/frappe/website/doctype/web_page_block/web_page_block.json index b415567bd0..77f2e25469 100644 --- a/frappe/website/doctype/web_page_block/web_page_block.json +++ b/frappe/website/doctype/web_page_block/web_page_block.json @@ -12,7 +12,8 @@ "column_break_5", "add_container", "add_padding", - "add_shade" + "add_shade", + "hide_block" ], "fields": [ { @@ -54,18 +55,24 @@ "default": "0", "fieldname": "add_shade", "fieldtype": "Check", - "label": "Shaded Section" + "label": "Add Gray Background" }, { "default": "1", "fieldname": "add_container", "fieldtype": "Check", "label": "Add Container" + }, + { + "default": "0", + "fieldname": "hide_block", + "fieldtype": "Check", + "label": "Hide Block" } ], "istable": 1, "links": [], - "modified": "2020-04-19 16:16:44.524042", + "modified": "2020-04-29 15:08:25.976179", "modified_by": "Administrator", "module": "Website", "name": "Web Page Block", From 4620074db49d94db938f1b1bf0549a7abe9d3b2d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 23:02:22 +0530 Subject: [PATCH 04/10] fix: Add Section Break for Cards Section template --- .../web_template_field.json | 4 +- .../section_with_cards.json | 98 ++++++++++++++----- 2 files changed, 75 insertions(+), 27 deletions(-) diff --git a/frappe/website/doctype/web_template_field/web_template_field.json b/frappe/website/doctype/web_template_field/web_template_field.json index 09335adf3a..900655e207 100644 --- a/frappe/website/doctype/web_template_field/web_template_field.json +++ b/frappe/website/doctype/web_template_field/web_template_field.json @@ -31,7 +31,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Fieldtype", - "options": "Attach Image\nCheck\nData\nInt\nSelect\nSmall Text\nText\nMarkdown Editor", + "options": "Attach Image\nCheck\nData\nInt\nSelect\nSmall Text\nText\nMarkdown Editor\nSection Break\nColumn Break", "reqd": 1 }, { @@ -48,7 +48,7 @@ ], "istable": 1, "links": [], - "modified": "2020-04-24 17:05:25.322767", + "modified": "2020-04-29 14:53:23.192395", "modified_by": "Administrator", "module": "Website", "name": "Web Template Field", diff --git a/frappe/website/web_template/section_with_cards/section_with_cards.json b/frappe/website/web_template/section_with_cards/section_with_cards.json index 89426651ad..9ec430ae60 100644 --- a/frappe/website/web_template/section_with_cards/section_with_cards.json +++ b/frappe/website/web_template/section_with_cards/section_with_cards.json @@ -22,153 +22,201 @@ "options": "Small\nMedium\nLarge", "reqd": 0 }, + { + "fieldname": "card_1", + "fieldtype": "Section Break", + "label": "Card 1", + "reqd": 0 + }, { "fieldname": "card_1_title", "fieldtype": "Data", - "label": "Card 1 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_1_content", "fieldtype": "Small Text", - "label": "Card 1 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_1_url", "fieldtype": "Data", - "label": "Card 1 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_2", + "fieldtype": "Section Break", + "label": "Card 2", "reqd": 0 }, { "fieldname": "card_2_title", "fieldtype": "Data", - "label": "Card 2 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_2_content", "fieldtype": "Small Text", - "label": "Card 2 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_2_url", "fieldtype": "Data", - "label": "Card 2 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_3", + "fieldtype": "Section Break", + "label": "Card 3", "reqd": 0 }, { "fieldname": "card_3_title", "fieldtype": "Data", - "label": "Card 3 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_3_content", "fieldtype": "Small Text", - "label": "Card 3 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_3_url", "fieldtype": "Data", - "label": "Card 3 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_4", + "fieldtype": "Section Break", + "label": "Card 4", "reqd": 0 }, { "fieldname": "card_4_title", "fieldtype": "Data", - "label": "Card 4 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_4_content", "fieldtype": "Small Text", - "label": "Card 4 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_4_url", "fieldtype": "Data", - "label": "Card 4 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_5", + "fieldtype": "Section Break", + "label": "Card 5", "reqd": 0 }, { "fieldname": "card_5_title", "fieldtype": "Data", - "label": "Card 5 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_5_content", "fieldtype": "Small Text", - "label": "Card 5 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_5_url", "fieldtype": "Data", - "label": "Card 5 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_6", + "fieldtype": "Section Break", + "label": "Card 6", "reqd": 0 }, { "fieldname": "card_6_title", "fieldtype": "Data", - "label": "Card 6 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_6_content", "fieldtype": "Small Text", - "label": "Card 6 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_6_url", "fieldtype": "Data", - "label": "Card 6 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_7", + "fieldtype": "Section Break", + "label": "Card 7", "reqd": 0 }, { "fieldname": "card_7_title", "fieldtype": "Data", - "label": "Card 7 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_7_content", "fieldtype": "Small Text", - "label": "Card 7 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_7_url", "fieldtype": "Data", - "label": "Card 7 URL", + "label": "URL", + "reqd": 0 + }, + { + "fieldname": "card_8", + "fieldtype": "Section Break", + "label": "Card 8", "reqd": 0 }, { "fieldname": "card_8_title", "fieldtype": "Data", - "label": "Card 8 Title", + "label": "Title", "reqd": 0 }, { "fieldname": "card_8_content", "fieldtype": "Small Text", - "label": "Card 8 Content", + "label": "Content", "reqd": 0 }, { "fieldname": "card_8_url", "fieldtype": "Data", - "label": "Card 8 URL", + "label": "URL", "reqd": 0 } ], "idx": 0, - "modified": "2020-04-21 21:24:04.192839", + "modified": "2020-04-29 22:40:03.362229", "modified_by": "Administrator", "name": "Section with Cards", "owner": "Administrator", From 2bbe26ada024824faeadefb5d85cff774eef4376 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 23:02:43 +0530 Subject: [PATCH 05/10] fix: Max height for hero image --- .../hero_with_right_image/hero_with_right_image.html | 2 +- tailwind.config.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html index 11d49eb287..8efc46a1b7 100644 --- a/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html +++ b/frappe/website/web_template/hero_with_right_image/hero_with_right_image.html @@ -23,7 +23,7 @@
{%- if image -%} {{ c('image_with_blur', - class=["hidden md:block", "w-full md:w-6/12" if contain_image else "md:max-w-md lg:max-w-lg xl:max-w-xl xxl:max-w-2xl"], + class=["hidden md:block max-h-144", "w-full md:w-6/12" if contain_image else "md:max-w-md lg:max-w-lg xl:max-w-xl xxl:max-w-2xl"], src=image, alt="") }} diff --git a/tailwind.config.js b/tailwind.config.js index e75ff16e85..03678ee166 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -46,6 +46,9 @@ module.exports = { borderRadius: { xl: '0.75rem' }, + maxHeight: { + '144': '36rem' + }, boxShadow: theme => ({ 'outline-primary': `0 0 0 3px ${rgba(theme('colors.blue.300'), 0.45)}` }), From 2788cf3d196cbf67bcfdc4ae182f2d2181c108bd Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 29 Apr 2020 23:03:46 +0530 Subject: [PATCH 06/10] fix: Clickable navbar button in firefox --- .../navbar_with_links_on_right.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html b/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html index ffa8be24da..01652f8c80 100644 --- a/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html +++ b/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html @@ -6,8 +6,8 @@
- -