Merge branch 'develop' into website-theme-fixes

This commit is contained in:
Suraj Shetty 2021-05-28 08:36:15 +05:30 committed by GitHub
commit 70348977be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 10 deletions

View file

@ -343,12 +343,7 @@ async function write_assets_json(metafile) {
}
}
let assets_json_path = path.resolve(
assets_path,
"frappe",
"dist",
"assets.json"
);
let assets_json_path = path.resolve(assets_path, "assets.json");
let assets_json;
try {
assets_json = await fs.promises.readFile(assets_json_path, "utf-8");

View file

@ -50,7 +50,7 @@ def build_missing_files():
development = frappe.local.conf.developer_mode or frappe.local.dev_server
build_mode = "development" if development else "production"
assets_json = frappe.read_file(frappe.get_app_path('frappe', 'public', 'dist', 'assets.json'))
assets_json = frappe.read_file("assets/assets.json")
if assets_json:
assets_json = frappe.parse_json(assets_json)

View file

@ -200,10 +200,11 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
if(frappe.model.can_create(doctype)) {
// new item
r.results.push({
label: "<span class='text-primary link-option'>"
html: "<span class='text-primary link-option'>"
+ "<i class='fa fa-plus' style='margin-right: 5px;'></i> "
+ __("Create a new {0}", [__(me.get_options())])
+ "</span>",
label: __("Create a new {0}", [__(me.get_options())]),
value: "create_new__link_option",
action: me.new_doc
});
@ -213,10 +214,11 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
if (locals && locals['DocType']) {
// not applicable in web forms
r.results.push({
label: "<span class='text-primary link-option'>"
html: "<span class='text-primary link-option'>"
+ "<i class='fa fa-search' style='margin-right: 5px;'></i> "
+ __("Advanced Search")
+ "</span>",
label: __("Advanced Search"),
value: "advanced_search__link_option",
action: me.open_advanced_search
});

View file

@ -809,7 +809,7 @@ def get_assets_json():
assets_json = None
if not assets_json:
assets_json = frappe.read_file("assets/frappe/dist/assets.json")
assets_json = frappe.read_file("assets/assets.json")
cache.set_value("assets_json", assets_json, shared=True)
frappe.local.assets_json = frappe.safe_decode(assets_json)