Nabin Hait | 10c6137 | 2021-04-13 15:46:01 +0530 | [diff] [blame] | 1 | // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | // MIT License. See license.txt |
| 3 | |
Ankush Menat | ec74a5e | 2024-03-10 19:45:40 +0530 | [diff] [blame] | 4 | frappe.ui.form.on("Website Theme", { |
Nabin Hait | 10c6137 | 2021-04-13 15:46:01 +0530 | [diff] [blame] | 5 | validate(frm) { |
| 6 | let theme_scss = frm.doc.theme_scss; |
Ankush Menat | ec74a5e | 2024-03-10 19:45:40 +0530 | [diff] [blame] | 7 | if ( |
| 8 | theme_scss && |
| 9 | theme_scss.includes("frappe/public/scss/website") && |
| 10 | !theme_scss.includes("erpnext/public/scss/website") |
Nabin Hait | 10c6137 | 2021-04-13 15:46:01 +0530 | [diff] [blame] | 11 | ) { |
Ankush Menat | ec74a5e | 2024-03-10 19:45:40 +0530 | [diff] [blame] | 12 | frm.set_value("theme_scss", `${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`); |
Nabin Hait | 10c6137 | 2021-04-13 15:46:01 +0530 | [diff] [blame] | 13 | } |
Ankush Menat | ec74a5e | 2024-03-10 19:45:40 +0530 | [diff] [blame] | 14 | }, |
Nabin Hait | 10c6137 | 2021-04-13 15:46:01 +0530 | [diff] [blame] | 15 | }); |