From aee3a3a554d910ae61614156f422bcc2a24cac32 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 21 Apr 2020 16:45:51 +0530 Subject: [PATCH] fix: Add responsive classes in web templates --- .../footer_horizontal/footer_horizontal.html | 6 +- frappe/website/web_template/hero/hero.html | 4 +- frappe/website/web_template/hero/hero.json | 9 ++- .../hero_with_right_image.html | 56 +++++++------------ .../navbar_with_links_on_right.html | 40 +++++++++++-- .../section_with_big_cards.html | 5 +- .../section_with_cta/section_with_cta.html | 8 +-- .../section_with_image.html | 2 +- .../section_with_small_cards.html | 2 +- .../section_with_tabs/section_with_tabs.html | 10 ++-- 10 files changed, 82 insertions(+), 60 deletions(-) diff --git a/frappe/website/web_template/footer_horizontal/footer_horizontal.html b/frappe/website/web_template/footer_horizontal/footer_horizontal.html index 507c80bd42..0c3335bb9d 100644 --- a/frappe/website/web_template/footer_horizontal/footer_horizontal.html +++ b/frappe/website/web_template/footer_horizontal/footer_horizontal.html @@ -2,7 +2,7 @@
Brand Logo
-
+
{%- for index in ['1', '2', '3', '4', '5'] -%} {%- set label = values['item_' + index + '_label'] -%} @@ -14,11 +14,11 @@ {%- endfor -%}
-
+
{{ address }}
-
+
{{ copyright }}
diff --git a/frappe/website/web_template/hero/hero.html b/frappe/website/web_template/hero/hero.html index a3f1ada408..7fd4ab0b05 100644 --- a/frappe/website/web_template/hero/hero.html +++ b/frappe/website/web_template/hero/hero.html @@ -13,7 +13,7 @@ {%- if primary_action -%} @@ -21,7 +21,7 @@ {%- if secondary_action -%} diff --git a/frappe/website/web_template/hero/hero.json b/frappe/website/web_template/hero/hero.json index 97fdbab7e0..37e06b802d 100644 --- a/frappe/website/web_template/hero/hero.json +++ b/frappe/website/web_template/hero/hero.json @@ -38,10 +38,17 @@ "fieldtype": "Data", "label": "Secondary Action", "reqd": 0 + }, + { + "fieldname": "align", + "fieldtype": "Select", + "label": "Align", + "options": "Left\nCenter", + "reqd": 0 } ], "idx": 0, - "modified": "2020-04-19 15:26:23.140620", + "modified": "2020-04-20 12:27:45.760391", "modified_by": "Administrator", "name": "Hero", "owner": "Administrator", 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 a5855d95c1..e68a830d54 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,42 +1,28 @@ -
-
-
-
-
-

- {{ title }} -

- {%- if subtitle -%} -

- {{ subtitle }} -

- {%- endif -%} -
- {%- if primary_action -%} - - {%- endif -%} - {%- if secondary_action -%} - - {%- endif -%} -
-
+
+
+
+

+ {{ title }} +

+ {%- if subtitle -%} +

+ {{ subtitle }} +

+ {%- endif -%} +
+ {%- 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 -%}
{%- if image -%} -
+ {%- endif -%} 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 ee8b5c17bd..4961729c7c 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 @@ -1,12 +1,42 @@ -
-
-
+
+
+ -
+
+ + + +
+ {%- for index in ['1', '2', '3', '4', '5'] -%} + + {%- set label = values['item_' + index + '_label'] -%} + {%- set url = values['item_' + index + '_url'] -%} + + {%- if label and url -%} +
+ {{ c('navbar_link', label=label, url=url) }} +
+ {%- endif -%} + + {%- endfor -%} + + {%- if cta_label and cta_url -%} + {{ c('button', label=cta_label, url=cta_url, variant="primary", class="mt-2") }} + {%- endif -%} +
+
+