2019-03-19 06:18:32 +00:00
|
|
|
// Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
|
|
|
// MIT License. See license.txt
|
|
|
|
|
|
|
|
frappe.ui.form.on('Website Theme', {
|
2019-06-14 14:36:54 +00:00
|
|
|
validate(frm) {
|
|
|
|
let theme_scss = frm.doc.theme_scss;
|
2020-07-30 11:52:29 +00:00
|
|
|
if (theme_scss && (theme_scss.includes('frappe/public/scss/website')
|
|
|
|
&& !theme_scss.includes('erpnext/public/scss/website'))
|
2019-03-19 06:18:32 +00:00
|
|
|
) {
|
2019-06-14 14:36:54 +00:00
|
|
|
frm.set_value('theme_scss',
|
|
|
|
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
|
2019-03-19 06:18:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|