From 4f8548d0ab13c393d15a123bf2b22e1732263dbe Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 11 May 2020 16:28:57 +0530 Subject: [PATCH] fix: Delete unused web templates - Also Patch --- frappe/patches.txt | 1 + .../remove_tailwind_from_page_builder.py | 13 +++ .../footer_horizontal/__init__.py | 0 .../footer_horizontal/footer_horizontal.html | 34 ------ .../footer_horizontal/footer_horizontal.json | 103 ------------------ .../navbar_with_links_on_right/__init__.py | 0 .../navbar_with_links_on_right.html | 56 ---------- .../navbar_with_links_on_right.json | 97 ----------------- 8 files changed, 14 insertions(+), 290 deletions(-) create mode 100644 frappe/patches/v13_0/remove_tailwind_from_page_builder.py delete mode 100644 frappe/website/web_template/footer_horizontal/__init__.py delete mode 100644 frappe/website/web_template/footer_horizontal/footer_horizontal.html delete mode 100644 frappe/website/web_template/footer_horizontal/footer_horizontal.json delete mode 100644 frappe/website/web_template/navbar_with_links_on_right/__init__.py delete mode 100644 frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html delete mode 100644 frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.json diff --git a/frappe/patches.txt b/frappe/patches.txt index a086fa6f4a..b73f2aea83 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -278,3 +278,4 @@ frappe.patches.v13_0.set_path_for_homepage_in_web_page_view frappe.patches.v13_0.migrate_translation_column_data frappe.patches.v13_0.set_read_times frappe.patches.v13_0.remove_web_view +frappe.patches.v13_0.remove_tailwind_from_page_builder diff --git a/frappe/patches/v13_0/remove_tailwind_from_page_builder.py b/frappe/patches/v13_0/remove_tailwind_from_page_builder.py new file mode 100644 index 0000000000..6e7bf67bac --- /dev/null +++ b/frappe/patches/v13_0/remove_tailwind_from_page_builder.py @@ -0,0 +1,13 @@ +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +# MIT License. See license.txt + +from __future__ import unicode_literals +import frappe + + +def execute(): + frappe.reload_doc("website", "doctype", "web_page_block") + # remove unused templates + frappe.delete_doc("Web Template", "Navbar with Links on Right", force=1) + frappe.delete_doc("Web Template", "Footer Horizontal", force=1) + diff --git a/frappe/website/web_template/footer_horizontal/__init__.py b/frappe/website/web_template/footer_horizontal/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/frappe/website/web_template/footer_horizontal/footer_horizontal.html b/frappe/website/web_template/footer_horizontal/footer_horizontal.html deleted file mode 100644 index 10af7a7a34..0000000000 --- a/frappe/website/web_template/footer_horizontal/footer_horizontal.html +++ /dev/null @@ -1,34 +0,0 @@ -
- {%- if brand_image -%} -
- {{ brand_label or 'Brand Logo' }} -
- {%- endif -%} -
-
- {%- for index in ['1', '2', '3', '4', '5', '6', '7', '8'] -%} - - {%- 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 content -%} -
- {{ content }} -
- {%- endif -%} -
-
-
- {{ address or '' }} -
-
- {{ copyright or '' }} -
-
-
diff --git a/frappe/website/web_template/footer_horizontal/footer_horizontal.json b/frappe/website/web_template/footer_horizontal/footer_horizontal.json deleted file mode 100644 index 5e17f80eb1..0000000000 --- a/frappe/website/web_template/footer_horizontal/footer_horizontal.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "creation": "2020-04-19 15:01:23.344637", - "docstatus": 0, - "doctype": "Web Template", - "fields": [ - { - "fieldname": "brand_image", - "fieldtype": "Attach Image", - "label": "Brand Image", - "reqd": 0 - }, - { - "fieldname": "brand_label", - "fieldtype": "Data", - "label": "Brand Label", - "reqd": 0 - }, - { - "fieldname": "address", - "fieldtype": "Small Text", - "label": "Address", - "reqd": 0 - }, - { - "fieldname": "copyright", - "fieldtype": "Small Text", - "label": "Copyright", - "reqd": 0 - }, - { - "fieldname": "item_1_label", - "fieldtype": "Data", - "label": "Item 1 Label", - "reqd": 0 - }, - { - "fieldname": "item_1_url", - "fieldtype": "Data", - "label": "Item 1 URL", - "reqd": 0 - }, - { - "fieldname": "item_2_label", - "fieldtype": "Data", - "label": "Item 2 Label", - "reqd": 0 - }, - { - "fieldname": "item_2_url", - "fieldtype": "Data", - "label": "Item 2 URL", - "reqd": 0 - }, - { - "fieldname": "item_3_label", - "fieldtype": "Data", - "label": "Item 3 Label", - "reqd": 0 - }, - { - "fieldname": "item_3_url", - "fieldtype": "Data", - "label": "Item 3 URL", - "reqd": 0 - }, - { - "fieldname": "item_4_label", - "fieldtype": "Data", - "label": "Item 4 Label", - "reqd": 0 - }, - { - "fieldname": "item_4_url", - "fieldtype": "Data", - "label": "Item 4 URL", - "reqd": 0 - }, - { - "fieldname": "item_5_label", - "fieldtype": "Data", - "label": "Item 5 Label", - "reqd": 0 - }, - { - "fieldname": "item_5_url", - "fieldtype": "Data", - "label": "Item 5 URL", - "reqd": 0 - }, - { - "fieldname": "content", - "fieldtype": "Markdown Editor", - "label": "Content", - "reqd": 0 - } - ], - "idx": 0, - "modified": "2020-04-26 15:14:15.892042", - "modified_by": "Administrator", - "name": "Footer Horizontal", - "owner": "Administrator", - "standard": 1 -} \ No newline at end of file diff --git a/frappe/website/web_template/navbar_with_links_on_right/__init__.py b/frappe/website/web_template/navbar_with_links_on_right/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 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 deleted file mode 100644 index 01652f8c80..0000000000 --- a/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.html +++ /dev/null @@ -1,56 +0,0 @@ -
-
-
- - Brand Logo - -
-
- - - - -
- -
-
diff --git a/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.json b/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.json deleted file mode 100644 index 8b3200d19e..0000000000 --- a/frappe/website/web_template/navbar_with_links_on_right/navbar_with_links_on_right.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "creation": "2020-04-19 13:49:33.971237", - "docstatus": 0, - "doctype": "Web Template", - "fields": [ - { - "fieldname": "brand_image", - "fieldtype": "Attach Image", - "label": "Brand Image", - "reqd": 0 - }, - { - "fieldname": "brand_label", - "fieldtype": "Data", - "label": "Brand Label", - "reqd": 0 - }, - { - "fieldname": "cta_label", - "fieldtype": "Data", - "label": "CTA Label", - "reqd": 0 - }, - { - "fieldname": "cta_url", - "fieldtype": "Data", - "label": "CTA URL", - "reqd": 0 - }, - { - "fieldname": "item_1_label", - "fieldtype": "Data", - "label": "Item 1 Label", - "reqd": 0 - }, - { - "fieldname": "item_1_url", - "fieldtype": "Data", - "label": "Item 1 URL", - "reqd": 0 - }, - { - "fieldname": "item_2_label", - "fieldtype": "Data", - "label": "Item 2 Label", - "reqd": 0 - }, - { - "fieldname": "item_2_url", - "fieldtype": "Data", - "label": "Item 2 URL", - "reqd": 0 - }, - { - "fieldname": "item_3_label", - "fieldtype": "Data", - "label": "Item 3 Label", - "reqd": 0 - }, - { - "fieldname": "item_3_url", - "fieldtype": "Data", - "label": "Item 3 URL", - "reqd": 0 - }, - { - "fieldname": "item_4_label", - "fieldtype": "Data", - "label": "Item 4 Label", - "reqd": 0 - }, - { - "fieldname": "item_4_url", - "fieldtype": "Data", - "label": "Item 4 URL", - "reqd": 0 - }, - { - "fieldname": "item_5_label", - "fieldtype": "Data", - "label": "Item 5 Label", - "reqd": 0 - }, - { - "fieldname": "item_5_url", - "fieldtype": "Data", - "label": "Item 5 URL", - "reqd": 0 - } - ], - "idx": 0, - "modified": "2020-04-19 13:51:26.391098", - "modified_by": "Administrator", - "name": "Navbar with Links on Right", - "owner": "Administrator", - "standard": 1 -} \ No newline at end of file