fix(minor): Standard theme naming. It will be common across sites

This commit is contained in:
Rushabh Mehta 2020-04-21 11:41:55 +05:30
parent 0c19735386
commit c0f66f3dac
2 changed files with 8 additions and 4 deletions

View file

@ -61,10 +61,13 @@ class WebsiteTheme(Document):
from subprocess import Popen, PIPE
folder_path = join_path(frappe.utils.get_bench_path(), 'sites', 'assets', 'css')
self.delete_old_theme_files(folder_path)
if not self.custom:
self.delete_old_theme_files(folder_path)
# add a random suffix
file_name = frappe.scrub(self.name) + '_' + frappe.generate_hash('Website Theme', 8) + '.css'
suffix = frappe.generate_hash('Website Theme', 8) if self.custom else 'style'
file_name = frappe.scrub(self.name) + '_' + suffix + '.css'
output_path = join_path(folder_path, file_name)
content = get_scss(self)

View file

@ -7,13 +7,14 @@
"docstatus": 0,
"doctype": "Website Theme",
"font_properties": "300,600",
"font_size": "",
"idx": 27,
"modified": "2020-04-20 23:42:31.649416",
"modified": "2020-04-21 02:10:31.761219",
"modified_by": "Administrator",
"module": "Website",
"name": "Standard",
"owner": "Administrator",
"theme": "Standard",
"theme_scss": "$enable-shadows: false;\n$enable-gradients: false;\n$enable-rounded: true;\n\n@import \"frappe/public/scss/website\";\n\n",
"theme_url": "/assets/css/standard_88c91a7c.css"
"theme_url": "/assets/css/standard_style.css"
}