fix: Delete unused web templates

- Also Patch
This commit is contained in:
Faris Ansari 2020-05-11 16:28:57 +05:30
parent 7a87be29c4
commit 4f8548d0ab
8 changed files with 14 additions and 290 deletions

View file

@ -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

View file

@ -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)

View file

@ -1,34 +0,0 @@
<div class="py-16">
{%- if brand_image -%}
<div class="w-20">
<img class="w-auto h-8 sm:h-10" src="{{ brand_image }}" alt="{{ brand_label or 'Brand Logo' }}">
</div>
{%- endif -%}
<div class="flex flex-col md:flex-row md:items-center md:justify-between">
<div class="grid items-center grid-cols-2 gap-4 my-4 sm:flex sm:space-x-4">
{%- 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 -%}
</div>
{%- if content -%}
<div class="my-4">
{{ content }}
</div>
{%- endif -%}
</div>
<div class="flex flex-col items-start justify-between pt-4 text-xs text-gray-700 border-t-2 sm:flex-row">
<div>
{{ address or '' }}
</div>
<div class="mt-4 sm:mt-0">
{{ copyright or '' }}
</div>
</div>
</div>

View file

@ -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
}

View file

@ -1,56 +0,0 @@
<div class="py-2 bg-white border-b border-gray-200 xxl:py-4">
<div class="container relative z-10 flex items-center justify-between">
<div class="flex items-end flex-shrink-0 w-20">
<a href="/" class="block">
<img class="w-auto h-8 sm:h-10" src="{{ brand_image }}" alt="Brand Logo">
</a>
</div>
<details class="z-10 flex items-center sm:hidden hide-summary-arrow">
<summary class="block h-6 list-none cursor-pointer focus:outline-none focus:shadow-outline">
<button class="pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</summary>
<nav class="absolute inset-x-0 flex flex-col px-4 py-4 bg-white shadow-md">
{%- for index in ['1', '2', '3', '4', '5'] -%}
{%- set label = values['item_' + index + '_label'] -%}
{%- set url = values['item_' + index + '_url'] -%}
{%- if label and url -%}
<div class="py-2">
{{ c('navbar_link', label=label, url=url) }}
</div>
{%- endif -%}
{%- endfor -%}
{%- if cta_label and cta_url -%}
{{ c('button', label=cta_label, url=cta_url, variant="primary", class="mt-2") }}
{%- endif -%}
</nav>
</details>
<nav class="items-center hidden text-sm leading-5 sm:flex space-x-8">
{%- 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") }}
{%- endif -%}
</nav>
</div>
</div>

View file

@ -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
}