Merge pull request #17953 from netchampfaris/website-theme-import

fix: Add erpnext website theme import
This commit is contained in:
Suraj Shetty 2019-06-17 12:56:24 +05:30 committed by GitHub
commit ec6afbbe99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,16 +2,13 @@
// MIT License. See license.txt // MIT License. See license.txt
frappe.ui.form.on('Website Theme', { frappe.ui.form.on('Website Theme', {
apply_custom_theme(frm) { validate(frm) {
let custom_theme = frm.doc.custom_theme; let theme_scss = frm.doc.theme_scss;
custom_theme = custom_theme.split('\n'); if (theme_scss.includes('frappe/public/scss/website')
if ( && !theme_scss.includes('erpnext/public/scss/website')
frm.doc.apply_custom_theme
&& custom_theme.length === 2
&& custom_theme[1].includes('frappe/public/scss/website')
) { ) {
frm.set_value('custom_theme', frm.set_value('theme_scss',
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`); `${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
} }
} }
}); });